-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add async await to all tests (#31)
- Loading branch information
Showing
5 changed files
with
80 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ styled-system-studio | |
/test-results/ | ||
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ | ||
/e2e/.cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('Vite is running', async ({ page }) => { | ||
await page.goto('/'); | ||
await expect(page).toHaveTitle(/Vite \+ React/); | ||
}); | ||
|
||
test.describe('codegen', () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/'); | ||
}); | ||
|
||
test('semantic token references', async ({ page }) => { | ||
await expect(page.getByText('{colors.tone.positive}')).toHaveClass( | ||
'bg_{colors.tone.positive}', | ||
); | ||
await expect(page.getByText('{colors.tone.negative}')).toHaveClass( | ||
'bg_{colors.tone.negative}', | ||
); | ||
}); | ||
|
||
test('raw values', async ({ page }) => { | ||
await expect(page.getByText('#0000ff')).toHaveClass('bg_#0000ff'); | ||
await expect(page.getByText('#ff0000')).toHaveClass('bg_#ff0000'); | ||
}); | ||
|
||
test('value keys', async ({ page }) => { | ||
await expect(page.getByText('#9a9a9a')).toHaveClass('bg_#9a9a9a'); | ||
await expect( | ||
page.getByText('{"base":"#000","lg":"#555","_hover":"#999"}'), | ||
).toHaveClass('bg_#000 lg:bg_#555 hover:bg_#999'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test.describe('parser', () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/'); | ||
}); | ||
|
||
test('semantic tokens', async ({ page }) => { | ||
await expect(page.getByText('{colors.tone.positive}')).toHaveCSS( | ||
'background-color', | ||
'rgb(34, 197, 94)', | ||
); | ||
|
||
await expect(page.getByText('{colors.tone.positive}')).toHaveCSS( | ||
'background-color', | ||
'rgb(34, 197, 94)', | ||
); | ||
}); | ||
|
||
test('raw values', async ({ page }) => { | ||
await expect(page.getByText('#0000ff')).toHaveCSS( | ||
'background-color', | ||
'rgb(0, 0, 255)', | ||
); | ||
await expect(page.getByText('#ff0000')).toHaveCSS( | ||
'background-color', | ||
'rgb(255, 0, 0)', | ||
); | ||
}); | ||
|
||
test('value keys', async ({ page }) => { | ||
await expect(page.getByText('#9a9a9a')).toHaveCSS( | ||
'background-color', | ||
'rgb(154, 154, 154)', | ||
); | ||
|
||
const el = page.getByText('{"base":"#000","lg":"#555","_hover":"#999"}'); | ||
|
||
await expect(el).toHaveCSS('background-color', 'rgb(85, 85, 85)'); | ||
await page.setViewportSize({ width: 320, height: 568 }); | ||
await expect(el).toHaveCSS('background-color', 'rgb(0, 0, 0)'); | ||
await el.hover(); | ||
await expect(el).toHaveCSS('background-color', 'rgb(153, 153, 153)'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.