diff --git a/.changeset/tricky-socks-cheer.md b/.changeset/tricky-socks-cheer.md new file mode 100644 index 000000000000..2be0a27228f9 --- /dev/null +++ b/.changeset/tricky-socks-cheer.md @@ -0,0 +1,5 @@ +--- +"@ledgerhq/ui": minor +--- + +Fixed e2e testing and next build issues on ci workflows diff --git a/.github/workflows/test-design-system-reusable.yml b/.github/workflows/test-design-system-reusable.yml index db25fb37885b..b2548c28ffee 100644 --- a/.github/workflows/test-design-system-reusable.yml +++ b/.github/workflows/test-design-system-reusable.yml @@ -57,7 +57,7 @@ jobs: run: pnpm i --filter="./libs/ui/**" - name: Build and Test affected libraries id: test-ui - run: pnpm run test --continue --filter="./libs/ui/*" --filter="!./apps/ledger-live*...[${{ inputs.since_branch && format('origin/{0}', inputs.since_branch) || 'HEAD^1' }}]" --api="http://127.0.0.1:${{ steps.toolchain.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo" + run: pnpm run test --continue --filter="./libs/ui/**" --filter="!./apps/ledger-live*...[${{ inputs.since_branch && format('origin/{0}', inputs.since_branch) || 'HEAD^1' }}]" --api="http://127.0.0.1:${{ steps.toolchain.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo" shell: bash - name: (On Failure) Upload react-ui test results uses: actions/upload-artifact@v4 diff --git a/libs/ui/package.json b/libs/ui/package.json index b26df997643b..59cae060de85 100644 --- a/libs/ui/package.json +++ b/libs/ui/package.json @@ -10,13 +10,15 @@ "@ledgerhq/ui-shared": "workspace:^", "@playwright/test": "~1.40.0", "concurrently": "^8.0.0", + "cross-env": "^7.0.3", "json": "^11.0.0", "lint-staged": "^14.0.0" }, "scripts": { "pretest:react": "playwright install", - "test:react": "node tests/react.script webpack.js && node tests/react.script next.js", - "pretest:react:update-snapshots": "playwright install", - "test:react:update-snapshots": "env UPDATE_SNAPSHOTS=1 node tests/react.script webpack.js && env UPDATE_SNAPSHOTS=1 node tests/react.script next.js" + "clean": "pnpm -F ./examples/webpack.js -F ./examples/next.js clean:full", + "build-and-test": "pnpm pretest:react && pnpm build-next && pnpm e2e", + "build-next": "pnpm -w -F ./examples/webpack.js build", + "e2e": "cross-env UPDATE_SNAPSHOTS=1 pnpm concurrently -s=first -k \"pnpm -w -F ./examples/webpack.js serve\" \"playwright test $([ \"$UPDATE_SNAPSHOTS\" = 1 ] && echo \"--update-snapshots\")\"" } } diff --git a/libs/ui/packages/react/package.json b/libs/ui/packages/react/package.json index 5fe181860e61..fbbfb2340793 100644 --- a/libs/ui/packages/react/package.json +++ b/libs/ui/packages/react/package.json @@ -66,7 +66,7 @@ "lint:fix": "pnpm lint --fix", "lint:css": "stylelint './src/**/*.{js,jsx,ts,tsx}' --fix", "typecheck": "tsc --p . --noEmit", - "test": "pnpm -w -F ui test:react", + "test": "pnpm -w -F ui build-and-test", "unimported": "unimported" }, "dependencies": { diff --git a/libs/ui/tests/react.spec.js-snapshots/dark-darwin.png b/libs/ui/tests/react.spec.js-snapshots/dark-darwin.png index c788d27a2d0a..d63711253db1 100644 Binary files a/libs/ui/tests/react.spec.js-snapshots/dark-darwin.png and b/libs/ui/tests/react.spec.js-snapshots/dark-darwin.png differ diff --git a/libs/ui/tests/react.spec.js-snapshots/light-darwin.png b/libs/ui/tests/react.spec.js-snapshots/light-darwin.png index cf65bd5aa2b4..5672b059bcdb 100644 Binary files a/libs/ui/tests/react.spec.js-snapshots/light-darwin.png and b/libs/ui/tests/react.spec.js-snapshots/light-darwin.png differ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d157542b424a..ff93094563b9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6230,6 +6230,9 @@ importers: concurrently: specifier: ^8.0.0 version: 8.2.2 + cross-env: + specifier: ^7.0.3 + version: 7.0.3 json: specifier: ^11.0.0 version: 11.0.0