Skip to content

Commit

Permalink
test: use new auth API and js-auth helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
malessani committed Apr 4, 2024
1 parent 0b8647f commit 0c66f42
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 247 deletions.
11 changes: 4 additions & 7 deletions .env.local.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ NEXT_PUBLIC_SLUG=
NEXT_PUBLIC_DOMAIN=
NEXT_PUBLIC_HOSTED=

# Environment Variables for test suite only
E2E_CLIENT_ID=
E2E_ENDPOINT=
E2E_CLIENT_SECRET=
E2E_BASE_URL=
E2E_BASE_PORT=
E2E_BASE_PROTOCOL=

E2E_MARKET_ID=
E2E_MARKET_ID_SINGLE_SHIPPING_METHOD=
E2E_MARKET_ID_SHIP_FROM_PRIMARY=
E2E_BASE_PORT=3000
E2E_BASE_PROTOCOL=http

E2E_INTEGRATION_CLIENT_ID=
E2E_INTEGRATION_CLIENT_SECRET=
Expand Down
2 changes: 1 addition & 1 deletion components/data/AppProvider/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export const fetchOrder = (cl: CommerceLayerClient, orderId: string) => {
"line_items",
],
shipments: ["shipping_method", "available_shipping_methods"],
customer: ["customer_addresses"],
customers: ["customer_addresses"],
customer_addresses: ["address"],
line_items: ["frequency"],
},
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"commercelayer"
],
"dependencies": {
"@commercelayer/js-auth": "^6.0.0",
"@commercelayer/organization-config": "^1.4.5",
"@commercelayer/react-components": "^4.12.0",
"@commercelayer/sdk": "^5.36.0",
Expand All @@ -82,7 +83,7 @@
"@tailwindcss/forms": "^0.5.7",
"@types/async-retry": "1.4.8",
"@types/jsonwebtoken": "^9.0.6",
"@types/node": "^20.12.2",
"@types/node": "^20.12.3",
"@types/react": "^18.2.74",
"@types/react-gtm-module": "^2.0.3",
"@types/styled-components": "^5.1.34",
Expand All @@ -92,11 +93,9 @@
"babel-plugin-styled-components": "^2.1.4",
"classnames": "^2.5.1",
"cron-parser": "^4.9.0",
"cronstrue": "^2.48.0",
"cronstrue": "^2.49.0",
"dotenv": "^16.4.5",
"i18next": "^23.10.1",
"jsonwebtoken": "^9.0.2",
"jwt-decode": "^4.0.0",
"next": "^14.1.4",
"next-build-id": "^3.0.0",
"next-i18next": "^15.2.0",
Expand All @@ -117,7 +116,7 @@
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.0.2",
"@semantic-release/npm": "^12.0.0",
"@semantic-release/release-notes-generator": "^12.1.0",
"@semantic-release/release-notes-generator": "^13.0.0",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"eslint": "^8.57.0",
Expand Down Expand Up @@ -149,4 +148,4 @@
"cacheDirectories": [
".next/cache"
]
}
}
132 changes: 25 additions & 107 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion specs/fixtures/CheckoutPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class CheckoutPage {
// // Add a prefix to the title.
const body = {
data: {
id: process.env.E2E_ORGANIZATION_ID as string,
id: "organization-id",
type: "organizations",
attributes: {
name: process.env.NEXT_PUBLIC_SLUG as string,
Expand Down
Loading

0 comments on commit 0c66f42

Please sign in to comment.