2022-08-12 05:05:13 +00:00
|
|
|
import { expect, test } from 'vitest'
|
2022-05-11 09:03:19 +00:00
|
|
|
import { findAssetFile, isBuild, page } from '~utils'
|
2021-01-08 23:37:49 +00:00
|
|
|
|
|
|
|
test('plain', async () => {
|
|
|
|
expect(await page.textContent('.plain')).toBe('hi')
|
|
|
|
})
|
|
|
|
|
|
|
|
test('base64', async () => {
|
|
|
|
expect(await page.textContent('.base64')).toBe('hi')
|
|
|
|
})
|
|
|
|
|
2023-12-15 15:35:39 +00:00
|
|
|
test('svg data uri minify', async () => {
|
|
|
|
const sqdqs = await page.getByTestId('sqdqs').boundingBox()
|
|
|
|
const sqsdqs = await page.getByTestId('sqsdqs').boundingBox()
|
|
|
|
const dqsqs = await page.getByTestId('dqsqs').boundingBox()
|
|
|
|
const dqssqs = await page.getByTestId('dqssqs').boundingBox()
|
|
|
|
|
|
|
|
expect(sqdqs.height).toBe(100)
|
|
|
|
expect(sqsdqs.height).toBe(100)
|
|
|
|
expect(dqsqs.height).toBe(100)
|
|
|
|
expect(dqssqs.height).toBe(100)
|
|
|
|
})
|
|
|
|
|
2022-05-11 06:33:20 +00:00
|
|
|
test.runIf(isBuild)('should compile away the import for build', async () => {
|
|
|
|
const file = findAssetFile('index')
|
|
|
|
expect(file).not.toMatch('import')
|
|
|
|
})
|