Skip to content

Commit 7a53b1f

Browse files
committed
test: test style
1 parent dd66ac2 commit 7a53b1f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

playground/rolldown-dev-react/__tests__/basic.spec.ts

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { test } from 'vitest'
1+
import { expect, test } from 'vitest'
22
import { editFile, isBuild, page, viteTestUrl } from '../../test-utils'
33

44
test('basic', async () => {
@@ -10,6 +10,24 @@ test('basic', async () => {
1010
await page.getByText('[alias] test-alias-dest:ok').click()
1111
})
1212

13+
test('style', async () => {
14+
expect(
15+
await page
16+
.locator('.test-style')
17+
.evaluate((el) => getComputedStyle(el).color),
18+
).toBe('rgb(255, 165, 0)')
19+
expect(
20+
await page
21+
.locator('.test-style-url')
22+
.evaluate((el) => getComputedStyle(el).color),
23+
).toBe('rgb(255, 165, 0)')
24+
expect(
25+
await page
26+
.locator('.test-style-inline')
27+
.evaluate((el) => getComputedStyle(el).color),
28+
).toBe('rgb(255, 165, 0)')
29+
})
30+
1331
test.runIf(!isBuild)('hmr', async () => {
1432
await page.goto(viteTestUrl)
1533
await page.getByRole('button', { name: 'Count: 0' }).click()

0 commit comments

Comments
 (0)