Skip to content

Commit

Permalink
test(css): css-codesplit flaky test (#12653)
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0day committed Mar 29, 2023
1 parent 9e13f5f commit 1953f3f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions playground/css-codesplit/__tests__/css-codesplit.spec.ts
@@ -1,5 +1,12 @@
import { describe, expect, test } from 'vitest'
import { findAssetFile, getColor, isBuild, page, readManifest } from '~utils'
import {
findAssetFile,
getColor,
isBuild,
page,
readManifest,
untilUpdated,
} from '~utils'

test('should load all stylesheets', async () => {
expect(await getColor('h1')).toBe('red')
Expand All @@ -25,7 +32,7 @@ test('should load dynamic import with module', async () => {
test('style order should be consistent when style tag is inserted by JS', async () => {
expect(await getColor('.order-bulk')).toBe('orange')
await page.click('.order-bulk-update')
expect(await getColor('.order-bulk')).toBe('green')
await untilUpdated(() => getColor('.order-bulk'), 'green')
})

describe.runIf(isBuild)('build', () => {
Expand Down

0 comments on commit 1953f3f

Please sign in to comment.