diff --git a/Makefile b/Makefile index 1795cf270..2e9e5903f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SHELL=/bin/bash -euo pipefail +SHELL=/bin/bash -o pipefail export GO111MODULE := on export PATH := .bin:${PATH} @@ -10,6 +10,11 @@ install: test: npm run test +test-containerized: + # https://github.com/microsoft/playwright/issues/26482 + # For unsupported distros, use the `test-containerized` target instead of `test` + sh -c ./playwright-docker.sh + format: .bin/ory node_modules .bin/ory dev headers copyright --type=open-source npm exec -- prettier --write . diff --git a/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-chromium-linux.png b/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-chromium-linux.png new file mode 100644 index 000000000..5df8ae84d Binary files /dev/null and b/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-chromium-linux.png differ diff --git a/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-firefox-linux.png b/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-firefox-linux.png new file mode 100644 index 000000000..69d851c5c Binary files /dev/null and b/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-firefox-linux.png differ diff --git a/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-webkit-linux.png b/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-webkit-linux.png new file mode 100644 index 000000000..f92141d20 Binary files /dev/null and b/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-webkit-linux.png differ diff --git a/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-chromium-linux.png b/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-chromium-linux.png new file mode 100644 index 000000000..f3e279f52 Binary files /dev/null and b/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-chromium-linux.png differ diff --git a/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-firefox-linux.png b/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-firefox-linux.png new file mode 100644 index 000000000..9561a5e6b Binary files /dev/null and b/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-firefox-linux.png differ diff --git a/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-webkit-linux.png b/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-webkit-linux.png new file mode 100644 index 000000000..5b2c5fd1f Binary files /dev/null and b/examples/nextjs-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-webkit-linux.png differ diff --git a/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-chromium-linux.png b/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-chromium-linux.png new file mode 100644 index 000000000..b31728b27 Binary files /dev/null and b/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-chromium-linux.png differ diff --git a/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-firefox-linux.png b/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-firefox-linux.png new file mode 100644 index 000000000..ee395b72a Binary files /dev/null and b/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-firefox-linux.png differ diff --git a/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-webkit-linux.png b/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-webkit-linux.png new file mode 100644 index 000000000..6d611d738 Binary files /dev/null and b/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-webkit-linux.png differ diff --git a/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-chromium-linux.png b/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-chromium-linux.png new file mode 100644 index 000000000..ed91161b2 Binary files /dev/null and b/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-chromium-linux.png differ diff --git a/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-firefox-linux.png b/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-firefox-linux.png new file mode 100644 index 000000000..94bebe66c Binary files /dev/null and b/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-firefox-linux.png differ diff --git a/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-webkit-linux.png b/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-webkit-linux.png new file mode 100644 index 000000000..992a9618c Binary files /dev/null and b/examples/nextjs-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-webkit-linux.png differ diff --git a/examples/nextjs-spa/package.json b/examples/nextjs-spa/package.json index 21c88c193..92a5cbe4d 100644 --- a/examples/nextjs-spa/package.json +++ b/examples/nextjs-spa/package.json @@ -20,12 +20,12 @@ "next": "13.4.13", "react": "18.2.0", "react-dom": "18.2.0", - "typescript": "4.9.4" + "typescript": "5.2.2" }, "devDependencies": { "@ory/elements": "*", "@ory/elements-test": "*", - "autoprefixer": "10.4.2", - "@playwright/test": "1.32.1" + "@playwright/test": "1.38.0", + "autoprefixer": "10.4.2" } } diff --git a/examples/nextjs-spa/playwright.config.ts b/examples/nextjs-spa/playwright.config.ts index 3b7407f1f..30b170b3f 100644 --- a/examples/nextjs-spa/playwright.config.ts +++ b/examples/nextjs-spa/playwright.config.ts @@ -23,6 +23,9 @@ export default defineConfig({ * For example in `await expect(locator).toHaveText();` */ timeout: 5000, + toHaveScreenshot: { + maxDiffPixelRatio: 0.02, + }, }, /* Run tests in files in parallel */ fullyParallel: true, @@ -57,12 +60,10 @@ export default defineConfig({ name: "firefox", use: { ...devices["Desktop Firefox"] }, }, - - // disabling for now as it cancels reloading the page on the same URL - // { - // name: "webkit", - // use: { ...devices["Desktop Safari"] }, - // }, + { + name: "webkit", + use: { ...devices["Desktop Safari"] }, + }, ], /* Folder for test artifacts such as screenshots, videos, traces, etc. */ @@ -77,7 +78,7 @@ export default defineConfig({ env: { NEXT_PUBLIC_ORY_SDK_URL: "http://localhost:4000", }, - command: "npm run dev -- --port 3100", + command: "npm run build && npm run start -- --port 3100", timeout: 120 * 1000, port: 3100, reuseExistingServer: !process.env.CI, diff --git a/examples/nextjs-spa/src/pages/recovery.tsx b/examples/nextjs-spa/src/pages/recovery.tsx index b43a43bf0..4628b1e4b 100644 --- a/examples/nextjs-spa/src/pages/recovery.tsx +++ b/examples/nextjs-spa/src/pages/recovery.tsx @@ -20,7 +20,7 @@ import { SetUriFlow } from "@/pkg/helpers" import { NextPageWithLayout } from "./_app" const Recovery: NextPageWithLayout = () => { - const [flow, setFlow] = useState() + const [flow, setFlow] = useState() // Get flow information from the URL const router = useRouter() @@ -84,8 +84,10 @@ const Recovery: NextPageWithLayout = () => { updateRecoveryFlowBody: values, }) .then(({ data }) => { + // reset the form data completely + setFlow(null) // Form submission was successful, show the message to the user! - setFlow(data) + getFlow(data.id) }) .catch(handleError) diff --git a/examples/nextjs-spa/src/pages/verification.tsx b/examples/nextjs-spa/src/pages/verification.tsx index 5269ab11a..25e5f7dfd 100644 --- a/examples/nextjs-spa/src/pages/verification.tsx +++ b/examples/nextjs-spa/src/pages/verification.tsx @@ -81,8 +81,10 @@ const Verification: NextPageWithLayout = () => { updateVerificationFlowBody: values, }) .then(({ data }) => { + // reset the input fields + setFlow(null) // Form submission was successful, show the message to the user! - setFlow(data) + getFlow(data.id) }) .catch(handleError) diff --git a/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-chromium-linux.png b/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-chromium-linux.png new file mode 100644 index 000000000..a10e0e568 Binary files /dev/null and b/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-chromium-linux.png differ diff --git a/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-firefox-linux.png b/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-firefox-linux.png new file mode 100644 index 000000000..c094111e1 Binary files /dev/null and b/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-firefox-linux.png differ diff --git a/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-webkit-linux.png b/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-webkit-linux.png new file mode 100644 index 000000000..40e4a9d4d Binary files /dev/null and b/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-webkit-linux.png differ diff --git a/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-chromium-linux.png b/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-chromium-linux.png new file mode 100644 index 000000000..afec8056b Binary files /dev/null and b/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-chromium-linux.png differ diff --git a/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-firefox-linux.png b/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-firefox-linux.png new file mode 100644 index 000000000..de2cfbf67 Binary files /dev/null and b/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-firefox-linux.png differ diff --git a/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-webkit-linux.png b/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-webkit-linux.png new file mode 100644 index 000000000..e4c26d5ba Binary files /dev/null and b/examples/preact-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-webkit-linux.png differ diff --git a/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-chromium-linux.png b/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-chromium-linux.png new file mode 100644 index 000000000..af0522a2e Binary files /dev/null and b/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-chromium-linux.png differ diff --git a/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-firefox-linux.png b/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-firefox-linux.png new file mode 100644 index 000000000..c382b3d8b Binary files /dev/null and b/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-firefox-linux.png differ diff --git a/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-webkit-linux.png b/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-webkit-linux.png new file mode 100644 index 000000000..69c578535 Binary files /dev/null and b/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-webkit-linux.png differ diff --git a/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-chromium-linux.png b/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-chromium-linux.png new file mode 100644 index 000000000..8d07cc1d4 Binary files /dev/null and b/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-chromium-linux.png differ diff --git a/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-firefox-linux.png b/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-firefox-linux.png new file mode 100644 index 000000000..832e7c3d5 Binary files /dev/null and b/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-firefox-linux.png differ diff --git a/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-webkit-linux.png b/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-webkit-linux.png new file mode 100644 index 000000000..d8c4d31f5 Binary files /dev/null and b/examples/preact-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-webkit-linux.png differ diff --git a/examples/preact-spa/package.json b/examples/preact-spa/package.json index ac7e60db3..9c8b8b1c2 100644 --- a/examples/preact-spa/package.json +++ b/examples/preact-spa/package.json @@ -17,11 +17,11 @@ "devDependencies": { "@ory/elements-preact": "*", "@ory/elements-test": "*", - "@playwright/test": "1.32.1", "@preact/preset-vite": "2.5.0", "eslint": "8.32.0", "eslint-config-preact": "1.3.0", - "typescript": "4.9.4", + "typescript": "5.2.2", + "@playwright/test": "1.38.0", "vite": "4.0.5" }, "eslintConfig": { diff --git a/examples/preact-spa/playwright.config.ts b/examples/preact-spa/playwright.config.ts index 59296e532..d3f0e5de6 100644 --- a/examples/preact-spa/playwright.config.ts +++ b/examples/preact-spa/playwright.config.ts @@ -22,6 +22,9 @@ export default defineConfig({ * For example in `await expect(locator).toHaveText();` */ timeout: 5000, + toHaveScreenshot: { + maxDiffPixelRatio: 0.02, + }, }, /* Run tests in files in parallel */ fullyParallel: true, @@ -51,12 +54,10 @@ export default defineConfig({ name: "chromium", use: { ...devices["Desktop Chrome"] }, }, - { name: "firefox", use: { ...devices["Desktop Firefox"] }, }, - { name: "webkit", use: { ...devices["Desktop Safari"] }, diff --git a/examples/preact-spa/src/recovery.tsx b/examples/preact-spa/src/recovery.tsx index c77af5d73..06dc1cda3 100644 --- a/examples/preact-spa/src/recovery.tsx +++ b/examples/preact-spa/src/recovery.tsx @@ -42,7 +42,8 @@ export const Recovery = () => { }) .then(({ data: flow }) => { // Form submission was successful, show the message to the user! - setFlow(flow) + setFlow(null) + getFlow(flow.id) }) .catch(sdkErrorHandler) } diff --git a/examples/preact-spa/src/verification.tsx b/examples/preact-spa/src/verification.tsx index 98a2122a8..a7958c548 100644 --- a/examples/preact-spa/src/verification.tsx +++ b/examples/preact-spa/src/verification.tsx @@ -42,7 +42,8 @@ export const Verification = () => { updateVerificationFlowBody: body, }) .then(({ data: flow }) => { - setFlow(flow) + setFlow(null) + getFlow(flow.id) }) .catch(sdkErrorHandler) } diff --git a/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-chromium-linux.png b/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-chromium-linux.png new file mode 100644 index 000000000..f29775bd4 Binary files /dev/null and b/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-chromium-linux.png differ diff --git a/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-firefox-linux.png b/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-firefox-linux.png new file mode 100644 index 000000000..ad233a99f Binary files /dev/null and b/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-firefox-linux.png differ diff --git a/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-webkit-linux.png b/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-webkit-linux.png new file mode 100644 index 000000000..18775a679 Binary files /dev/null and b/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-1-webkit-linux.png differ diff --git a/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-chromium-linux.png b/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-chromium-linux.png new file mode 100644 index 000000000..8aad9c334 Binary files /dev/null and b/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-chromium-linux.png differ diff --git a/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-firefox-linux.png b/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-firefox-linux.png new file mode 100644 index 000000000..b990abeeb Binary files /dev/null and b/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-firefox-linux.png differ diff --git a/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-webkit-linux.png b/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-webkit-linux.png new file mode 100644 index 000000000..dbbcf3fc4 Binary files /dev/null and b/examples/react-spa/e2e/recovery.spec.ts-snapshots/Recovery-Page-recovery-success-2-webkit-linux.png differ diff --git a/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-chromium-linux.png b/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-chromium-linux.png new file mode 100644 index 000000000..2129b36c1 Binary files /dev/null and b/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-chromium-linux.png differ diff --git a/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-firefox-linux.png b/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-firefox-linux.png new file mode 100644 index 000000000..45fc38979 Binary files /dev/null and b/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-firefox-linux.png differ diff --git a/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-webkit-linux.png b/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-webkit-linux.png new file mode 100644 index 000000000..2a82397a9 Binary files /dev/null and b/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-1-webkit-linux.png differ diff --git a/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-chromium-linux.png b/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-chromium-linux.png new file mode 100644 index 000000000..0d32db583 Binary files /dev/null and b/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-chromium-linux.png differ diff --git a/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-firefox-linux.png b/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-firefox-linux.png new file mode 100644 index 000000000..352e574be Binary files /dev/null and b/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-firefox-linux.png differ diff --git a/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-webkit-linux.png b/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-webkit-linux.png new file mode 100644 index 000000000..17e0e252c Binary files /dev/null and b/examples/react-spa/e2e/verification.spec.ts-snapshots/Verification-Page-verification-success-2-webkit-linux.png differ diff --git a/examples/react-spa/package.json b/examples/react-spa/package.json index 911555d27..5ac09b521 100644 --- a/examples/react-spa/package.json +++ b/examples/react-spa/package.json @@ -18,7 +18,7 @@ "devDependencies": { "@ory/elements": "*", "@ory/elements-test": "*", - "@playwright/test": "1.32.1", + "@playwright/test": "1.38.0", "@types/react": "18.2.14", "@types/react-dom": "18.2.6", "@typescript-eslint/eslint-plugin": "5.49.0", @@ -29,7 +29,7 @@ "eslint-plugin-n": "15.6.1", "eslint-plugin-promise": "6.1.1", "eslint-plugin-react": "7.32.2", - "typescript": "5.1.6", + "typescript": "5.2.2", "vite": "4.4.2" } } diff --git a/examples/react-spa/playwright.config.ts b/examples/react-spa/playwright.config.ts index f1fec4a99..c0657afb6 100644 --- a/examples/react-spa/playwright.config.ts +++ b/examples/react-spa/playwright.config.ts @@ -22,6 +22,9 @@ export default defineConfig({ * For example in `await expect(locator).toHaveText();` */ timeout: 5000, + toHaveScreenshot: { + maxDiffPixelRatio: 0.02, + }, }, /* Run tests in files in parallel */ fullyParallel: true, diff --git a/examples/react-spa/src/Recovery.tsx b/examples/react-spa/src/Recovery.tsx index bf56389b7..0aebd7489 100644 --- a/examples/react-spa/src/Recovery.tsx +++ b/examples/react-spa/src/Recovery.tsx @@ -44,7 +44,8 @@ export const Recovery = () => { .updateRecoveryFlow({ flow: flow.id, updateRecoveryFlowBody: body }) .then(({ data: flow }) => { // Form submission was successful, show the message to the user! - setFlow(flow) + setFlow(null) + getFlow(flow.id) }) .catch(sdkErrorHandler) } diff --git a/examples/react-spa/src/Verification.tsx b/examples/react-spa/src/Verification.tsx index 4e4582400..5dcb866df 100644 --- a/examples/react-spa/src/Verification.tsx +++ b/examples/react-spa/src/Verification.tsx @@ -49,7 +49,8 @@ export const Verification = (): JSX.Element => { updateVerificationFlowBody: body, }) .then(({ data: flow }) => { - setFlow(flow) + setFlow(null) + getFlow(flow.id) }) .catch(sdkErrorHandler) } diff --git a/package-lock.json b/package-lock.json index fdbaf0f3c..6c3cc43dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,10 +16,10 @@ }, "devDependencies": { "@babel/core": "7.18.10", - "@ory/client": "1.2.4", + "@ory/client": "1.2.8", "@ory/integrations": "1.1.5", - "@playwright/experimental-ct-react": "1.32.1", - "@playwright/test": "1.32.1", + "@playwright/experimental-ct-react": "1.38.0", + "@playwright/test": "1.38.0", "@preact/preset-vite": "2.5.0", "@storybook/addon-docs": "7.4.0", "@storybook/addon-essentials": "7.4.0", @@ -44,8 +44,14 @@ "autoprefixer": "10.4.15", "chromatic": "6.21.0", "classnames": "2.3.2", - "eslint": "8.32.0", + "eslint": "8.49.0", + "eslint-config-semistandard": "17.0.0", + "eslint-config-standard": "17.1.0", "eslint-plugin-formatjs": "4.10.3", + "eslint-plugin-import": "2.28.1", + "eslint-plugin-n": "15.7.0", + "eslint-plugin-playwright": "0.16.0", + "eslint-plugin-promise": "6.1.1", "eslint-plugin-react": "7.32.2", "eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-storybook": "0.6.13", @@ -83,12 +89,12 @@ "next": "13.4.13", "react": "18.2.0", "react-dom": "18.2.0", - "typescript": "4.9.4" + "typescript": "5.2.2" }, "devDependencies": { "@ory/elements": "*", "@ory/elements-test": "*", - "@playwright/test": "1.32.1", + "@playwright/test": "1.38.0", "autoprefixer": "10.4.2" } }, @@ -119,6 +125,61 @@ "postcss": "^8.1.0" } }, + "examples/nextjs-spa/node_modules/eslint": { + "version": "8.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.32.0.tgz", + "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==", + "dependencies": { + "@eslint/eslintrc": "^1.4.1", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.4.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "examples/nextjs-spa/node_modules/typescript": { "version": "4.9.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", @@ -140,11 +201,11 @@ "devDependencies": { "@ory/elements-preact": "*", "@ory/elements-test": "*", - "@playwright/test": "1.32.1", + "@playwright/test": "1.38.0", "@preact/preset-vite": "2.5.0", "eslint": "8.32.0", "eslint-config-preact": "1.3.0", - "typescript": "4.9.4", + "typescript": "5.2.2", "vite": "4.0.5" } }, @@ -201,6 +262,62 @@ "@esbuild/win32-x64": "0.16.17" } }, + "examples/preact-spa/node_modules/eslint": { + "version": "8.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.32.0.tgz", + "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==", + "dev": true, + "dependencies": { + "@eslint/eslintrc": "^1.4.1", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.4.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "examples/preact-spa/node_modules/typescript": { "version": "4.9.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", @@ -273,7 +390,7 @@ "devDependencies": { "@ory/elements": "*", "@ory/elements-test": "*", - "@playwright/test": "1.32.1", + "@playwright/test": "1.38.0", "@types/react": "18.2.14", "@types/react-dom": "18.2.6", "@typescript-eslint/eslint-plugin": "5.49.0", @@ -284,7 +401,7 @@ "eslint-plugin-n": "15.6.1", "eslint-plugin-promise": "6.1.1", "eslint-plugin-react": "7.32.2", - "typescript": "5.1.6", + "typescript": "5.2.2", "vite": "4.4.2" } }, @@ -843,6 +960,90 @@ "url": "https://opencollective.com/eslint" } }, + "examples/react-spa/node_modules/eslint-plugin-import": { + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", + "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.7.4", + "has": "^1.0.3", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.6", + "resolve": "^1.22.1", + "semver": "^6.3.0", + "tsconfig-paths": "^3.14.1" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "examples/react-spa/node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "examples/react-spa/node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "examples/react-spa/node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "examples/react-spa/node_modules/eslint-plugin-n": { + "version": "15.6.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.6.1.tgz", + "integrity": "sha512-R9xw9OtCRxxaxaszTQmQAlPgM+RdGjaL1akWuY/Fv9fRAi8Wj4CUKc6iYVG8QNRjRuo8/BqVYIpfqberJUEacA==", + "dev": true, + "dependencies": { + "builtins": "^5.0.1", + "eslint-plugin-es": "^4.1.0", + "eslint-utils": "^3.0.0", + "ignore": "^5.1.1", + "is-core-module": "^2.11.0", + "minimatch": "^3.1.2", + "resolve": "^1.22.1", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "examples/react-spa/node_modules/typescript": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", @@ -911,6 +1112,14 @@ } } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@ampproject/remapping": { "version": "2.2.0", "dev": true, @@ -3554,6 +3763,15 @@ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, + "node_modules/@eslint-community/regexpp": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.1.tgz", + "integrity": "sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, "node_modules/@eslint/eslintrc": { "version": "1.4.1", "license": "MIT", @@ -3575,6 +3793,15 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/js": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.49.0.tgz", + "integrity": "sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@fal-works/esbuild-plugin-global-externals": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/@fal-works/esbuild-plugin-global-externals/-/esbuild-plugin-global-externals-2.1.2.tgz", @@ -3748,8 +3975,9 @@ "license": "MIT" }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", - "license": "Apache-2.0", + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", + "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", @@ -7444,9 +7672,9 @@ } }, "node_modules/@ory/client": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@ory/client/-/client-1.2.4.tgz", - "integrity": "sha512-iA3HTzzNJtsotIAKO9Jo4eeZs4ElXnI3F0p7iqZhMq5rGubWxRv2SC+vLgGOhDevkzsVI2UXYAbkXxloUxai5A==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@ory/client/-/client-1.2.8.tgz", + "integrity": "sha512-Exd4dVXMpcYqImv1zTvgRtHosY42LmFkgLKTbZWGF0XAmWHbHL4jBnoJkGwb2fhl8hohfeH0Chhmc57G8OfONA==", "dev": true, "dependencies": { "axios": "^0.21.4" @@ -7556,104 +7784,64 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/@playwright/experimental-ct-react": { - "version": "1.32.1", + "node_modules/@playwright/experimental-ct-core": { + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/@playwright/experimental-ct-core/-/experimental-ct-core-1.38.0.tgz", + "integrity": "sha512-jspVRe+D9/gM8aZ6g5TVybSKnYi9OfvUtq67WHo22OfxENXBdDe0hHHlLRQNSdmuKcE5goG8WNVZvOWjolTb/Q==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "@playwright/test": "1.32.1", - "@vitejs/plugin-react": "^3.1.0", - "vite": "^4.1.1" + "playwright": "1.38.0", + "playwright-core": "1.38.0", + "vite": "^4.3.9" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=14" - } - }, - "node_modules/@playwright/experimental-ct-react/node_modules/@babel/core": { - "version": "7.22.9", - "dev": true, - "license": "MIT", - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.9", - "@babel/helper-compilation-targets": "^7.22.9", - "@babel/helper-module-transforms": "^7.22.9", - "@babel/helpers": "^7.22.6", - "@babel/parser": "^7.22.7", - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.8", - "@babel/types": "^7.22.5", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" + "node": ">=16" } }, - "node_modules/@playwright/experimental-ct-react/node_modules/@vitejs/plugin-react": { - "version": "3.1.0", + "node_modules/@playwright/experimental-ct-core/node_modules/playwright-core": { + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.0.tgz", + "integrity": "sha512-f8z1y8J9zvmHoEhKgspmCvOExF2XdcxMW8jNRuX4vkQFrzV4MlZ55iwb5QeyiFQgOFCUolXiRHgpjSEnqvO48g==", "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.20.12", - "@babel/plugin-transform-react-jsx-self": "^7.18.6", - "@babel/plugin-transform-react-jsx-source": "^7.19.6", - "magic-string": "^0.27.0", - "react-refresh": "^0.14.0" + "bin": { + "playwright-core": "cli.js" }, "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "peerDependencies": { - "vite": "^4.1.0-beta.0" - } - }, - "node_modules/@playwright/experimental-ct-react/node_modules/semver": { - "version": "6.3.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" + "node": ">=16" } }, - "node_modules/@playwright/test": { - "version": "1.32.1", + "node_modules/@playwright/experimental-ct-react": { + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/@playwright/experimental-ct-react/-/experimental-ct-react-1.38.0.tgz", + "integrity": "sha512-RRQi99dNWDlkdSIUJpva5T0f+Nq6JSb0fR6MatvJDJkgiARaytk57SgquTmFHglyNu4p/Qj4lRxCCIEy0uZDGA==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "@types/node": "*", - "playwright-core": "1.32.1" + "@playwright/experimental-ct-core": "1.38.0", + "@vitejs/plugin-react": "^4.0.0" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=14" - }, - "optionalDependencies": { - "fsevents": "2.3.2" + "node": ">=16" } }, - "node_modules/@playwright/test/node_modules/playwright-core": { - "version": "1.32.1", + "node_modules/@playwright/test": { + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.0.tgz", + "integrity": "sha512-xis/RXXsLxwThKnlIXouxmIvvT3zvQj1JE39GsNieMUrMpb3/GySHDh2j8itCG22qKVD4MYLBp7xB73cUW/UUw==", "dev": true, - "license": "Apache-2.0", + "dependencies": { + "playwright": "1.38.0" + }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/@preact/preset-vite": { @@ -12576,6 +12764,24 @@ "node": ">=8" } }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", + "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array.prototype.flat": { "version": "1.3.1", "license": "MIT", @@ -12619,6 +12825,26 @@ "get-intrinsic": "^1.1.3" } }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/arrify": { "version": "2.0.1", "dev": true, @@ -14267,6 +14493,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/define-data-property": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", + "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/define-lazy-prop": { "version": "2.0.0", "license": "MIT", @@ -14647,16 +14886,18 @@ } }, "node_modules/es-abstract": { - "version": "1.21.2", - "license": "MIT", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz", + "integrity": "sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==", "dependencies": { "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.2", "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.2.0", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.1", "get-symbol-description": "^1.0.0", "globalthis": "^1.0.3", "gopd": "^1.0.1", @@ -14671,19 +14912,23 @@ "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", - "is-typed-array": "^1.1.10", + "is-typed-array": "^1.1.12", "is-weakref": "^1.0.2", "object-inspect": "^1.12.3", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.7", - "string.prototype.trimend": "^1.0.6", - "string.prototype.trimstart": "^1.0.6", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", "typed-array-length": "^1.0.4", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.9" + "which-typed-array": "^1.1.11" }, "engines": { "node": ">= 0.4" @@ -15185,47 +15430,47 @@ } }, "node_modules/eslint": { - "version": "8.32.0", - "license": "MIT", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.49.0.tgz", + "integrity": "sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==", + "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.4.1", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.49.0", + "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "bin": { @@ -15372,8 +15617,23 @@ "eslint": "6.x || 7.x || 8.x" } }, - "node_modules/eslint-config-standard": { + "node_modules/eslint-config-semistandard": { "version": "17.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-semistandard/-/eslint-config-semistandard-17.0.0.tgz", + "integrity": "sha512-tLi0JYmfiiJgtmRhoES55tENatR7y/5aXOh6cBeW+qjzl1+WwyV0arDqR65XN3/xrPZt+/1EG+xNLknV/0jWsQ==", + "dev": true, + "peerDependencies": { + "eslint": "^8.13.0", + "eslint-config-standard": "^17.0.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-n": "^15.0.0", + "eslint-plugin-promise": "^6.0.0" + } + }, + "node_modules/eslint-config-standard": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.1.0.tgz", + "integrity": "sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==", "dev": true, "funding": [ { @@ -15389,11 +15649,13 @@ "url": "https://feross.org/support" } ], - "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, "peerDependencies": { "eslint": "^8.0.1", "eslint-plugin-import": "^2.25.2", - "eslint-plugin-n": "^15.0.0", + "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", "eslint-plugin-promise": "^6.0.0" } }, @@ -15414,6 +15676,32 @@ "typescript": "*" } }, + "node_modules/eslint-config-standard-with-typescript/node_modules/eslint-config-standard": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz", + "integrity": "sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peerDependencies": { + "eslint": "^8.0.1", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0", + "eslint-plugin-promise": "^6.0.0" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.7", "license": "MIT", @@ -15481,8 +15769,9 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.7.4", - "license": "MIT", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dependencies": { "debug": "^3.2.7" }, @@ -15497,7 +15786,8 @@ }, "node_modules/eslint-module-utils/node_modules/debug": { "version": "3.2.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dependencies": { "ms": "^2.1.1" } @@ -15666,24 +15956,27 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.27.5", - "license": "MIT", + "version": "2.28.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz", + "integrity": "sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==", "dependencies": { "array-includes": "^3.1.6", + "array.prototype.findlastindex": "^1.2.2", "array.prototype.flat": "^1.3.1", "array.prototype.flatmap": "^1.3.1", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.7", - "eslint-module-utils": "^2.7.4", + "eslint-module-utils": "^2.8.0", "has": "^1.0.3", - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "is-glob": "^4.0.3", "minimatch": "^3.1.2", + "object.fromentries": "^2.0.6", + "object.groupby": "^1.0.0", "object.values": "^1.1.6", - "resolve": "^1.22.1", - "semver": "^6.3.0", - "tsconfig-paths": "^3.14.1" + "semver": "^6.3.1", + "tsconfig-paths": "^3.14.2" }, "engines": { "node": ">=4" @@ -15710,8 +16003,9 @@ } }, "node_modules/eslint-plugin-import/node_modules/semver": { - "version": "6.3.0", - "license": "ISC", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -15775,9 +16069,10 @@ } }, "node_modules/eslint-plugin-n": { - "version": "15.6.1", + "version": "15.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz", + "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==", "dev": true, - "license": "MIT", "dependencies": { "builtins": "^5.0.1", "eslint-plugin-es": "^4.1.0", @@ -15798,10 +16093,26 @@ "eslint": ">=7.0.0" } }, + "node_modules/eslint-plugin-playwright": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.16.0.tgz", + "integrity": "sha512-DcHpF0SLbNeh9MT4pMzUGuUSnJ7q5MWbP8sSEFIMS6j7Ggnduq8ghNlfhURgty4c1YFny7Ge9xYTO1FSAoV2Vw==", + "dev": true, + "peerDependencies": { + "eslint": ">=7", + "eslint-plugin-jest": ">=25" + }, + "peerDependenciesMeta": { + "eslint-plugin-jest": { + "optional": true + } + } + }, "node_modules/eslint-plugin-promise": { "version": "6.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", + "integrity": "sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==", "dev": true, - "license": "ISC", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -15913,14 +16224,18 @@ } }, "node_modules/eslint-scope": { - "version": "7.1.1", - "license": "BSD-2-Clause", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-utils": { @@ -15947,19 +16262,47 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "license": "Apache-2.0", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/@eslint/eslintrc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/espree": { - "version": "9.5.0", - "license": "BSD-2-Clause", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dependencies": { - "acorn": "^8.8.0", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -15969,8 +16312,9 @@ } }, "node_modules/espree/node_modules/acorn": { - "version": "8.8.2", - "license": "MIT", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "bin": { "acorn": "bin/acorn" }, @@ -16792,13 +17136,14 @@ "license": "MIT" }, "node_modules/function.prototype.name": { - "version": "1.1.5", - "license": "MIT", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" @@ -16836,11 +17181,13 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.0", - "license": "MIT", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" }, "funding": { @@ -17206,6 +17553,12 @@ "version": "1.0.4", "license": "MIT" }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "node_modules/gunzip-maybe": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/gunzip-maybe/-/gunzip-maybe-1.4.2.tgz", @@ -17949,8 +18302,9 @@ } }, "node_modules/is-core-module": { - "version": "2.11.0", - "license": "MIT", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dependencies": { "has": "^1.0.3" }, @@ -18236,14 +18590,11 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.10", - "license": "MIT", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "which-typed-array": "^1.1.11" }, "engines": { "node": ">= 0.4" @@ -20815,6 +21166,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.groupby": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", + "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1" + } + }, "node_modules/object.hasown": { "version": "1.1.2", "license": "MIT", @@ -20899,15 +21261,16 @@ } }, "node_modules/optionator": { - "version": "0.9.1", - "license": "MIT", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -21425,6 +21788,36 @@ "pathe": "^1.1.0" } }, + "node_modules/playwright": { + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.0.tgz", + "integrity": "sha512-fJGw+HO0YY+fU/F1N57DMO+TmXHTrmr905J05zwAQE9xkuwP/QLDk63rVhmyxh03dYnEhnRbsdbH9B0UVVRB3A==", + "dev": true, + "dependencies": { + "playwright-core": "1.38.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright/node_modules/playwright-core": { + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.0.tgz", + "integrity": "sha512-f8z1y8J9zvmHoEhKgspmCvOExF2XdcxMW8jNRuX4vkQFrzV4MlZ55iwb5QeyiFQgOFCUolXiRHgpjSEnqvO48g==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/polished": { "version": "4.2.2", "dev": true, @@ -22592,12 +22985,13 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.4.3", - "license": "MIT", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "set-function-name": "^2.0.0" }, "engines": { "node": ">= 0.4" @@ -22899,6 +23293,23 @@ "tslib": "^2.1.0" } }, + "node_modules/safe-array-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-buffer": { "version": "5.1.2", "dev": true, @@ -23053,6 +23464,19 @@ "dev": true, "license": "MIT" }, + "node_modules/set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -23527,12 +23951,13 @@ } }, "node_modules/string.prototype.trim": { - "version": "1.2.7", - "license": "MIT", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", + "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" @@ -23542,24 +23967,26 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.6", - "license": "MIT", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", + "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.6", - "license": "MIT", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -24138,6 +24565,54 @@ "node": ">= 0.6" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typed-array-length": { "version": "1.0.4", "license": "MIT", @@ -25346,15 +25821,15 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.9", - "license": "MIT", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -25371,13 +25846,6 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, - "node_modules/word-wrap": { - "version": "1.2.3", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/wordwrap": { "version": "1.0.0", "dev": true, diff --git a/package.json b/package.json index 50df3ead1..43c15f0ef 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,10 @@ "homepage": "https://github.com/ory/elements#readme", "devDependencies": { "@babel/core": "7.18.10", - "@ory/client": "1.2.4", + "@ory/client": "1.2.8", "@ory/integrations": "1.1.5", - "@playwright/experimental-ct-react": "1.32.1", - "@playwright/test": "1.32.1", + "@playwright/experimental-ct-react": "1.38.0", + "@playwright/test": "1.38.0", "@preact/preset-vite": "2.5.0", "@storybook/addon-docs": "7.4.0", "@storybook/addon-essentials": "7.4.0", @@ -57,8 +57,14 @@ "autoprefixer": "10.4.15", "chromatic": "6.21.0", "classnames": "2.3.2", - "eslint": "8.32.0", + "eslint": "8.49.0", + "eslint-config-semistandard": "17.0.0", + "eslint-config-standard": "17.1.0", "eslint-plugin-formatjs": "4.10.3", + "eslint-plugin-import": "2.28.1", + "eslint-plugin-n": "15.7.0", + "eslint-plugin-playwright": "0.16.0", + "eslint-plugin-promise": "6.1.1", "eslint-plugin-react": "7.32.2", "eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-storybook": "0.6.13", diff --git a/packages/test/vite.config.ts b/packages/test/vite.config.ts index 52a3cfdda..5beed3fc1 100644 --- a/packages/test/vite.config.ts +++ b/packages/test/vite.config.ts @@ -11,8 +11,8 @@ export default defineConfig({ dts({ root: path.resolve(__dirname, "../../src/test"), insertTypesEntry: true, - tsConfigFilePath: path.resolve(__dirname, "tsconfig.json"), - outputDir: path.resolve(__dirname, "dist"), + tsconfigPath: path.resolve(__dirname, "tsconfig.json"), + outDir: path.resolve(__dirname, "dist"), exclude: [ "node_modules", "dist", diff --git a/playwright-docker.sh b/playwright-docker.sh new file mode 100755 index 000000000..c1a97ccb1 --- /dev/null +++ b/playwright-docker.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# https://github.com/microsoft/playwright/issues/26482 +# For unsupported distros, use the `test-containerized` target instead of `test` +# NOTE: this script runs a playwright server inside docker and exposes the host network to the container +# this is to expose services (such as the application you want to test) to the playwright server +docker pull mcr.microsoft.com/playwright:v1.38.0-jammy +docker ps | grep mcr.microsoft.com/playwright:v1.38.0-jammy || docker run \ + -d --network="host" --add-host=host.docker.internal:host-gateway -p 9009:9009 --rm --init -it mcr.microsoft.com/playwright:v1.38.0-jammy \ + /bin/sh -c "cd /home/pwuser && npx -y playwright@1.38.0 run-server --port 9009" + +until npx --yes wscat -c ws://localhost:9009 &1>/dev/null; +do + echo "attempting to connect to playwright server in docker" + sleep 1 +done + + + +read -p "Select the project [elements, nextjs, react, preact]: " project +read -p "Update snapshots? [y/n]: " update_snapshots + +params=() +if [ "$update_snapshots" == "y" ]; then + params+=("--update-snapshots") +fi + +runTest() { + echo "testing $1" + PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:9009/ npm run test -- "${params[@]}" +} + +if [ "$project" != "elements" ] && [ "$project" != "nextjs" ] && [ "$project" != "react" ] && [ "$project" != "preact" ]; then + echo "Invalid project" + exit 1 +fi + +if [ "$project" == "elements" ]; then + echo "testing ory elements components" + runTest "elements" + exit 0 +fi + +if [ "$project" == "nextjs" ]; then + echo "testing nextjs app" + (cd examples/nextjs-spa && runTest "nextjs") + exit 0 +fi + +if [ "$project" == "react" ]; then + echo "testing react app" + (cd examples/react-spa && runTest "react") + exit 0 +fi + +if [ "$project" == "preact" ]; then + echo "testing preact app" + (cd examples/preact-spa && runTest "preact") +fi diff --git a/src/react-components/input-field.tsx b/src/react-components/input-field.tsx index d9dd5d8b4..35fa15cb6 100644 --- a/src/react-components/input-field.tsx +++ b/src/react-components/input-field.tsx @@ -1,5 +1,5 @@ import cn from "classnames" -import { JSX, useEffect, useRef, useState } from "react" +import { JSX, useRef, useState } from "react" import { gridStyle, @@ -18,7 +18,6 @@ export interface InputFieldProps helperMessage?: React.ReactNode | string messageTestId?: string dataTestid?: string - fullWidth?: boolean className?: string } diff --git a/src/react-components/ory/helpers/node.tsx b/src/react-components/ory/helpers/node.tsx index 5bb8905aa..ab2e65b4e 100644 --- a/src/react-components/ory/helpers/node.tsx +++ b/src/react-components/ory/helpers/node.tsx @@ -271,7 +271,6 @@ export const Node = ({ defaultValue={attrs.value} required={attrs.required} disabled={attrs.disabled} - fullWidth /> ) } diff --git a/src/test/mock/recovery.ts b/src/test/mock/recovery.ts index e467c8c4a..5fb32475f 100644 --- a/src/test/mock/recovery.ts +++ b/src/test/mock/recovery.ts @@ -34,6 +34,7 @@ export const RecoveryMocks = { const createResponse = await createRequest expect(createResponse.status()).toBe(200) + await expect(recoveryPage.page).toHaveScreenshot() // Validate that the form fields are present await recoveryPage.expectTraitFields() }) @@ -59,10 +60,15 @@ export const RecoveryMocks = { }) const submitRequest = recoveryPage.interceptSubmitResponse() + await recoveryPage.locator + .locator("input[name='email']") + .fill(recoveryPage.traits.email.value) await recoveryPage.submitForm() const submitResponse = await submitRequest expect(submitResponse.status()).toBe(200) + + await expect(recoveryPage.page).toHaveScreenshot() }) await test.step("submit the recovery form again with a valid code", async () => { @@ -79,6 +85,9 @@ export const RecoveryMocks = { // check that the form fields expect a code input field await recoveryPage.expectTraitFields(defaultRecoveryTraitsWithCode) + await recoveryPage.locator + .locator("input[name='code']") + .fill(defaultRecoveryTraitsWithCode.code.value) await recoveryPage.submitForm("[name='method'][type='submit']") const submitResponse = await submitRequest diff --git a/src/test/mock/verification.ts b/src/test/mock/verification.ts index 65cb8ba4a..e80600630 100644 --- a/src/test/mock/verification.ts +++ b/src/test/mock/verification.ts @@ -36,6 +36,8 @@ export const VerificationMocks = { expect(createResponse.status()).toBe(200) // Validate that the form fields are present await verificationPage.expectTraitFields() + + await expect(verificationPage.page).toHaveScreenshot() }) await test.step("mock the fetch verification flow", async () => { @@ -59,6 +61,9 @@ export const VerificationMocks = { }) const submitRequest = verificationPage.interceptSubmitResponse() + await verificationPage.locator + .locator("input[name='email']") + .fill(verificationPage.traits.email.value) await verificationPage.submitForm() const submitResponse = await submitRequest @@ -75,6 +80,8 @@ export const VerificationMocks = { required: true, }, }) + + await expect(verificationPage.page).toHaveScreenshot() }) await test.step("mock the submit verification code response", async () => { @@ -88,6 +95,9 @@ export const VerificationMocks = { await verificationPage.expectTraitFields( defaultVerificationTraitsWithCode, ) + await verificationPage.locator + .locator("input[name='code']") + .fill(defaultVerificationTraitsWithCode.code.value) await verificationPage.submitForm("[name='method'][type='submit']") const submitResponse = await submitRequest diff --git a/src/test/models/AuthPage.ts b/src/test/models/AuthPage.ts index 33bb4bdf6..4a52a2a24 100644 --- a/src/test/models/AuthPage.ts +++ b/src/test/models/AuthPage.ts @@ -123,7 +123,7 @@ export class AuthPage { return this.locator .page() .route(`**/self-service/${flow}/browser**`, async (route) => { - route.fulfill({ + await route.fulfill({ ...response, body: JSON.stringify(response?.body), }) @@ -134,7 +134,7 @@ export class AuthPage { return this.locator .page() .route(`**/self-service/${flow}/flows**`, async (route) => { - route.fulfill({ + await route.fulfill({ ...response, body: JSON.stringify(response?.body), }) @@ -145,7 +145,7 @@ export class AuthPage { return this.locator .page() .route(`**/self-service/${flow}?flow**`, async (route) => { - route.fulfill({ + await route.fulfill({ ...response, body: JSON.stringify(response?.body), }) diff --git a/src/test/models/RecoveryPage.ts b/src/test/models/RecoveryPage.ts index 319f2bb20..33fdd43f2 100644 --- a/src/test/models/RecoveryPage.ts +++ b/src/test/models/RecoveryPage.ts @@ -42,35 +42,44 @@ export class RecoveryPage extends AuthPage { getRecoveryFlowResponse( state: RecoveryFlowState = "choose_method", ): MockFlowResponse { - const body: RecoveryFlow = { - id: UUIDv4(), - type: "browser", - state: state, - expires_at: new Date().toISOString(), - issued_at: new Date().toISOString(), - request_url: this.pageUrl.href, - ui: { - action: new URL(this.recoveryActionPath, this.oryProjectUrl).href, - method: "POST", - nodes: traitsToNodes(this.traits, true), - messages: [], - }, + const body = (includeValues: boolean = false): RecoveryFlow => { + return { + id: UUIDv4(), + type: "browser", + state: state, + expires_at: new Date().toISOString(), + issued_at: new Date().toISOString(), + request_url: this.pageUrl.href, + ui: { + action: new URL(this.recoveryActionPath, this.oryProjectUrl).href, + method: "POST", + nodes: traitsToNodes(this.traits, true, includeValues), + messages: [], + }, + } } switch (state) { case "choose_method": return { ...defaultMockFlowResponse, - body, + body: body(), } case "sent_email": return { ...defaultMockFlowResponse, body: { - ...body, + ...body(), ui: { - ...body.ui, - nodes: traitsToNodes(defaultRecoveryTraitsWithCode, true), + ...body().ui, + nodes: traitsToNodes(defaultRecoveryTraitsWithCode, true, false), + messages: [ + { + id: 1060003, + text: "An email containing a recovery code has been sent to the email address you provided. If you have not received an email, check the spelling of the address and make sure to use the address you registered with.", + type: "info", + }, + ], }, }, } @@ -83,7 +92,7 @@ export class RecoveryPage extends AuthPage { default: return { ...defaultMockFlowResponse, - body, + body: body(), } } } diff --git a/src/test/models/VerificationPage.ts b/src/test/models/VerificationPage.ts index 040cfaa5a..a46a36d9c 100644 --- a/src/test/models/VerificationPage.ts +++ b/src/test/models/VerificationPage.ts @@ -53,7 +53,7 @@ export class VerificationPage extends AuthPage { ui: { action: new URL(this.verificationActionPath, this.oryProjectUrl).href, method: "POST", - nodes: traitsToNodes(this.traits, true), + nodes: traitsToNodes(this.traits, true, false), messages: [], }, } diff --git a/src/test/utils.ts b/src/test/utils.ts index 72573c97b..aff47ff46 100644 --- a/src/test/utils.ts +++ b/src/test/utils.ts @@ -32,6 +32,7 @@ export const inputNodesToRecord = (nodes: UiNode[]): Record => { export const traitsToNodes = ( traits: Record, includeCsrf?: boolean, + includeValue: boolean = true, ): UiNode[] => { const nodes = Object.entries(traits).map( ([key, { group, label, type, value, node_type, required, name }]) => { @@ -48,7 +49,7 @@ export const traitsToNodes = ( } as UiNodeMeta, attributes: { name: name || key, - value, + ...(includeValue && { value: value }), type, node_type: node_type || "input", required: required || false,