Skip to content

Commit 6905e86

Browse files
authored
chore: add e2e test (#53)
1 parent 96d3ca4 commit 6905e86

File tree

15 files changed

+1253
-33
lines changed

15 files changed

+1253
-33
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: PR Visual Tests
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
visual_tests:
8+
name: Visual Tests
9+
runs-on: ubuntu-latest
10+
container:
11+
image: mcr.microsoft.com/playwright:v1.51.1-jammy
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 22
17+
cache: npm
18+
- name: Install Packages
19+
run: npm ci
20+
- name: Run Visual Tests
21+
run: npm run playwright
22+
env:
23+
CI: 'true'
24+
- name: Upload Playwright Report
25+
if: always()
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: playwright-report
29+
path: ./playwright-report
30+
retention-days: 1
31+
- name: Save PR ID
32+
if: always()
33+
run: |
34+
pr="${{ github.event.pull_request.number }}"
35+
echo $pr > ./pr-id.txt
36+
shell: bash
37+
- name: Create PR Artifact
38+
if: always()
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: pr
42+
path: ./pr-id.txt

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ docs/diplodoc/pages/api
1212
storybook-static
1313
.cache
1414
.tmp
15+
playwright-report
16+
playwright-report-docker
17+
playwright/.cache-docker
18+
test-results

jest.config.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,11 @@ const esModules = [
99
].join('|');
1010

1111
module.exports = {
12-
// verbose: true,
13-
// preset: 'ts-jest',
14-
// testEnvironment: 'jsdom',
15-
// transform: {
16-
// '^.+\\.(js|ts)?$': 'ts-jest',
17-
// },
18-
// modulePathIgnorePatterns: ['<rootDir>/build/'],
19-
// transformIgnorePatterns: [`<rootDir>/node_modules/(?!${esModules})`],
20-
// moduleNameMapper: {
21-
// '^.+\\.(css|scss)$': '<rootDir>/test-utils/style.mock.ts',
22-
// },
23-
// setupFiles: ['<rootDir>/test-utils/globals.mock.ts'],
24-
// testPathIgnorePatterns: ['.visual.'],
2512
...createJsWithTsPreset(),
2613
transform: {
2714
'^.+\\.(js|ts)?$': ['ts-jest', {useESM: true}],
2815
},
2916
transformIgnorePatterns: [`<rootDir>/node_modules/(?!${esModules})`],
3017
testMatch: ['**/*.test.[jt]s?(x)'],
18+
testPathIgnorePatterns: ['.visual.'],
3119
};

0 commit comments

Comments
 (0)