Skip to content

Commit

Permalink
fix: Checkout widgets e2e tests (#2341)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhardwick authored Oct 22, 2024
1 parent 01d23ab commit fcca155
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/checkout/sdk-load-widgets-with-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"lint": "next lint",
"test": "playwright test",
"test:ui": "playwright test --ui",
"test:remotewidgets": "USE_LOCAL_BUNDLE=false playwright test"
"test:remotewidgets": "USE_REMOTE_WIDGETS=true playwright test"
},
"dependencies": {
"@biom3/react": "^0.25.21",
"@ethersproject/providers": "^5.7.2",
"@imtbl/sdk": "latest",
"@imtbl/sdk": "1.58.0",
"next": "14.2.7",
"react": "^18",
"react-dom": "^18"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ export const interceptWidgets = async (page: Page, widgetsVersion: string | 'lat
const fileName = path.basename(url.pathname);
let filePath = path.join(__dirname, 'local-widgets-js', fileName);

// Special case for widgets-esm.js
if (fileName === 'widgets-esm.js') {
filePath = path.join(__dirname, 'local-widgets-js', 'index.js');
}

try {
if (fs.existsSync(filePath)) {
const fileContent = fs.readFileSync(filePath, 'utf8');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { test, expect } from "@playwright/test";
import { interceptWidgets } from "./utils/intercept-widgets";

const useLocalBundle = process.env.USE_LOCAL_BUNDLE === 'true';

const USE_REMOTE_WIDGETS = process.env.USE_REMOTE_WIDGETS === 'true';

test.beforeEach(async ({ page }) => {
if (useLocalBundle) {
if (!USE_REMOTE_WIDGETS) {
await interceptWidgets(page);
}

Expand Down
81 changes: 80 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4193,7 +4193,7 @@ __metadata:
dependencies:
"@biom3/react": ^0.25.21
"@ethersproject/providers": ^5.7.2
"@imtbl/sdk": latest
"@imtbl/sdk": 1.58.0
"@playwright/test": ^1.45.3
"@types/node": ^20
"@types/react": ^18.3.4
Expand Down Expand Up @@ -5039,6 +5039,85 @@ __metadata:
languageName: unknown
linkType: soft

"@imtbl/sdk@npm:1.58.0":
version: 1.58.0
resolution: "@imtbl/sdk@npm:1.58.0"
dependencies:
"@0xsequence/abi": ^1.4.3
"@0xsequence/core": ^1.4.3
"@0xsquid/sdk": ^2.8.25
"@biom3/design-tokens": ^0.4.4
"@biom3/react": ^0.27.12
"@ethersproject/abi": ^5.7.0
"@ethersproject/abstract-provider": ^5.7.0
"@ethersproject/abstract-signer": ^5.7.0
"@ethersproject/address": ^5.7.0
"@ethersproject/bignumber": ^5.7.0
"@ethersproject/bytes": ^5.7.0
"@ethersproject/contracts": ^5.7.0
"@ethersproject/keccak256": ^5.7.0
"@ethersproject/providers": ^5.7.2
"@ethersproject/solidity": ^5.7.0
"@ethersproject/strings": ^5.7.0
"@ethersproject/units": ^5.7.0
"@ethersproject/wallet": ^5.7.0
"@imtbl/react-analytics": 0.2.1-alpha
"@jest/globals": ^29.5.0
"@magic-ext/oidc": 4.3.1
"@magic-sdk/provider": ^21.2.0
"@metamask/detect-provider": ^2.0.0
"@opensea/seaport-js": 4.0.3
"@rive-app/react-canvas-lite": ^4.9.0
"@stdlib/number-float64-base-normalize": 0.0.8
"@uniswap/router-sdk": ^1.4.0
"@uniswap/sdk-core": ^3.0.1
"@uniswap/v3-sdk": ^3.9.0
"@walletconnect/ethereum-provider": ^2.11.1
"@walletconnect/modal": ^2.6.2
assert: ^2.0.0
axios: ^1.6.5
bn.js: ^5.2.1
buffer: ^6.0.3
crypto-browserify: ^3.12.0
elliptic: ^6.5.7
enc-utils: ^3.0.0
ethereumjs-wallet: ^1.0.2
ethers: ^5.7.2
ethers-v6: "npm:[email protected]"
events: ^3.3.0
form-data: ^4.0.0
framer-motion: ^11.0.6
global-const: ^0.1.2
hash.js: ^1.1.7
https-browserify: ^1.0.0
i18next: ^23.7.6
i18next-browser-languagedetector: ^7.2.0
jwt-decode: ^3.1.2
localforage: ^1.10.0
lru-memorise: 0.3.0
magic-sdk: ^21.2.0
merkletreejs: ^0.3.11
oidc-client-ts: 2.4.0
os-browserify: ^0.3.0
pako: ^2.1.0
pg: ^8.11.5
pino-pretty: ^11.2.2
prisma: ^5.13.0
react-i18next: ^13.5.0
sns-validator: ^0.3.5
stream-browserify: ^3.0.0
stream-http: ^3.2.0
url: ^0.11.0
uuid: ^8.3.2
dependenciesMeta:
pg:
optional: true
prisma:
optional: true
checksum: 6f0d031f0db561ce51be24c66b4cd92e1abc3d568bfb279fdfd06ff5848ce2a6bbd4690226bae3ac0a876ed0dc42d1a8c0d3eae108ef6c24995b78a9ee74a490
languageName: node
linkType: hard

"@imtbl/sdk@npm:latest":
version: 1.56.0
resolution: "@imtbl/sdk@npm:1.56.0"
Expand Down

0 comments on commit fcca155

Please sign in to comment.