Skip to content

Commit

Permalink
test: test style
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Nov 13, 2024
1 parent dd66ac2 commit 7a53b1f
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion playground/rolldown-dev-react/__tests__/basic.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test } from 'vitest'
import { expect, test } from 'vitest'
import { editFile, isBuild, page, viteTestUrl } from '../../test-utils'

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

test('style', async () => {
expect(
await page
.locator('.test-style')
.evaluate((el) => getComputedStyle(el).color),
).toBe('rgb(255, 165, 0)')
expect(
await page
.locator('.test-style-url')
.evaluate((el) => getComputedStyle(el).color),
).toBe('rgb(255, 165, 0)')
expect(
await page
.locator('.test-style-inline')
.evaluate((el) => getComputedStyle(el).color),
).toBe('rgb(255, 165, 0)')
})

test.runIf(!isBuild)('hmr', async () => {
await page.goto(viteTestUrl)
await page.getByRole('button', { name: 'Count: 0' }).click()
Expand Down

0 comments on commit 7a53b1f

Please sign in to comment.