Skip to content

Commit

Permalink
test: recovery and verification snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Benehiko committed Sep 20, 2023
1 parent dd1bbcc commit 0c4ac62
Show file tree
Hide file tree
Showing 45 changed files with 153 additions and 128 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions examples/nextjs-spa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion examples/nextjs-spa/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,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,
Expand Down
6 changes: 4 additions & 2 deletions examples/nextjs-spa/src/pages/recovery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { SetUriFlow } from "@/pkg/helpers"
import { NextPageWithLayout } from "./_app"

const Recovery: NextPageWithLayout = () => {
const [flow, setFlow] = useState<RecoveryFlow>()
const [flow, setFlow] = useState<RecoveryFlow | null>()

// Get flow information from the URL
const router = useRouter()
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion examples/nextjs-spa/src/pages/verification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions examples/preact-spa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion examples/preact-spa/src/recovery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 2 additions & 1 deletion examples/preact-spa/src/verification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export const Verification = () => {
updateVerificationFlowBody: body,
})
.then(({ data: flow }) => {
setFlow(flow)
setFlow(null)
getFlow(flow.id)
})
.catch(sdkErrorHandler)
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions examples/react-spa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}
3 changes: 2 additions & 1 deletion examples/react-spa/src/Recovery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 2 additions & 1 deletion examples/react-spa/src/Verification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export const Verification = (): JSX.Element => {
updateVerificationFlowBody: body,
})
.then(({ data: flow }) => {
setFlow(flow)
setFlow(null)
getFlow(flow.id)
})
.catch(sdkErrorHandler)
}
Expand Down
154 changes: 72 additions & 82 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading

0 comments on commit 0c4ac62

Please sign in to comment.