Skip to content

Commit aaade82

Browse files
authored
test: add e2e tests (#25)
1 parent d1cccfe commit aaade82

20 files changed

+4118
-41
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/playwright.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Playwright
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
timeout-minutes: 30
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Install Playwright Browsers
26+
run: npx playwright install --with-deps
27+
28+
- name: Build plugin
29+
run: npm run build
30+
31+
- name: Prepare Vite app
32+
run: npm run vite:prepare
33+
34+
- name: Run Playwright tests
35+
run: npx playwright test
36+
37+
- uses: actions/upload-artifact@v4
38+
if: always()
39+
with:
40+
name: playwright-report
41+
path: playwright-report/
42+
retention-days: 14

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12-
timeout-minutes: 30
12+
timeout-minutes: 15
1313

1414
steps:
1515
- name: Checkout code
@@ -23,5 +23,8 @@ jobs:
2323
- name: Install dependencies
2424
run: npm ci
2525

26+
- name: Typecheck
27+
run: npm run typecheck
28+
2629
- name: Test
2730
run: npm run test:ci

.gitignore

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
/node_modules
2-
/dist
3-
/apps
4-
/coverage
1+
node_modules
2+
dist
3+
4+
/coverage
5+
6+
## Panda
7+
styled-system
8+
styled-system-studio
9+
10+
# WIP stuff
11+
/apps/fixtures/make.ts
12+
/apps/fixtures/scenarios.ts
13+
/apps/next-pages
14+
/apps/next-app
15+
16+
# Playwright
17+
/test-results/
18+
/playwright-report/
19+
/blob-report/
20+
/playwright/.cache/

apps/fixtures/tokens.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export const semanticTokens = {
2+
colors: {
3+
tone: {
4+
positive: { value: '{colors.green.500}' },
5+
negative: { value: '{colors.red.500}' },
6+
},
7+
},
8+
};
9+
10+
export const componentTokens = {
11+
raw: { red: '#ff0000', blue: '#0000ff' },
12+
valueKey: {
13+
string: { value: '#9a9a9a' },
14+
object: { value: { base: '#000', lg: '#555', _hover: '#999' } },
15+
},
16+
semantic: { green: '{colors.tone.positive}', red: '{colors.tone.negative}' },
17+
};

apps/vite-react/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Vite + React</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/src/main.tsx"></script>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)