Skip to content

Commit

Permalink
fix: libs/ui/tests spec related to snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
themooneer committed Sep 20, 2024
1 parent 570a25f commit 361b812
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 72 deletions.
66 changes: 0 additions & 66 deletions .github/workflows/build-and-test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,85 +19,19 @@ jobs:
head_branch: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
base_branch: ${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }}

# LLD
build-desktop:
name: "Build Desktop"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-desktop') && github.event.pull_request.head.repo.full_name == github.repository }}
uses: LedgerHQ/ledger-live/.github/workflows/build-desktop-reusable.yml@develop
secrets: inherit

test-desktop:
name: "Test Desktop"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-desktop') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-desktop-reusable.yml@develop
secrets: inherit

# LLM
build-mobile:
name: "Build Mobile"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-mobile') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/build-mobile-reusable.yml@develop
secrets: inherit

test-mobile:
name: "Test Mobile"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-mobile') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-reusable.yml@develop
secrets: inherit

test-mobile-e2e:
name: "Test Mobile E2E"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-mobile') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-e2e-reusable.yml@develop
secrets: inherit

# Tests
test-libraries:
name: "Test Libraries"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'libs') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-libs-reusable.yml@develop
secrets: inherit

test-design-system:
name: "Test Design System"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'libs/ui') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-design-system-reusable.yml@fix/test-ds-workflow
secrets: inherit

test-web-tools:
name: "Test Web Tools"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'apps/web-tools') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-web-tools-reusable.yml@develop
secrets: inherit

test-cli:
name: "Test CLI"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'apps/cli') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-cli-reusable.yml@develop
secrets: inherit

# Final Check required
ok:
name: "OK"
needs:
- build-desktop
- test-desktop
- build-mobile
- test-mobile
- test-mobile-e2e
- test-libraries
- test-design-system
- test-web-tools
- test-cli
runs-on: ubuntu-22.04
if: always() && !cancelled()
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-design-system-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 --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
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/examples/webpack.js/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin");

const isDevelopment = process.env.NODE_ENV !== "production";

console.log("test")
module.exports = {
mode: isDevelopment ? "development" : "production",
entry: "./src/index.js",
Expand Down
8 changes: 5 additions & 3 deletions libs/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"test:react": "pnpm clean && pnpm i && 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\")\""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type CloseProps = {
onPressDismiss?: () => void;
};

console.log("hello");
export const Container = styled(TouchableOpacity)`
background: ${(p) => p.theme.colors.opacityDefault.c05};
flex-direction: row;
Expand Down
Binary file modified libs/ui/tests/react.spec.js-snapshots/dark-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified libs/ui/tests/react.spec.js-snapshots/light-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 361b812

Please sign in to comment.