diff options
author | Sebastian <sebasjm@gmail.com> | 2023-04-21 10:47:47 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-04-21 10:47:47 -0300 |
commit | f470f167e32d8f7775ad994f09afb1d353b0b300 (patch) | |
tree | 3a1f2a040bb09d6639c81436b90b416fb8044f91 /packages/anastasis-webui/src/pages/home/ReviewPoliciesScreen.stories.tsx | |
parent | 6dcc488a2c8fd681941e5d3b62bb04af7669888e (diff) | |
download | wallet-core-f470f167e32d8f7775ad994f09afb1d353b0b300.tar.xz |
integrate anastasis to the web-utils testing api
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/ReviewPoliciesScreen.stories.tsx')
-rw-r--r-- | packages/anastasis-webui/src/pages/home/ReviewPoliciesScreen.stories.tsx | 457 |
1 files changed, 233 insertions, 224 deletions
diff --git a/packages/anastasis-webui/src/pages/home/ReviewPoliciesScreen.stories.tsx b/packages/anastasis-webui/src/pages/home/ReviewPoliciesScreen.stories.tsx index c5003d6a0..7cde84e0f 100644 --- a/packages/anastasis-webui/src/pages/home/ReviewPoliciesScreen.stories.tsx +++ b/packages/anastasis-webui/src/pages/home/ReviewPoliciesScreen.stories.tsx @@ -20,8 +20,9 @@ */ import { ReducerState } from "@gnu-taler/anastasis-core"; -import { createExample, reducerStatesExample } from "../../utils/index.js"; +import { reducerStatesExample } from "../../utils/index.js"; import { ReviewPoliciesScreen as TestedComponent } from "./ReviewPoliciesScreen.js"; +import { tests } from "@gnu-taler/web-util/lib/index.browser"; export default { title: "Reviewing Policies", @@ -35,227 +36,235 @@ export default { }, }; -export const HasPoliciesButMethodListIsEmpty = createExample(TestedComponent, { - ...reducerStatesExample.policyReview, - policies: [ - { - methods: [ - { - authentication_method: 0, - provider: "asd", - }, - { - authentication_method: 1, - provider: "asd", - }, - ], - }, - { - methods: [ - { - authentication_method: 1, - provider: "asd", - }, - ], - }, - ], - authentication_methods: [], -} as ReducerState); +export const HasPoliciesButMethodListIsEmpty = tests.createExample( + TestedComponent, + {}, + { + ...reducerStatesExample.policyReview, + policies: [ + { + methods: [ + { + authentication_method: 0, + provider: "asd", + }, + { + authentication_method: 1, + provider: "asd", + }, + ], + }, + { + methods: [ + { + authentication_method: 1, + provider: "asd", + }, + ], + }, + ], + authentication_methods: [], + } as ReducerState, +); -export const SomePoliciesWithMethods = createExample(TestedComponent, { - ...reducerStatesExample.policyReview, - policies: [ - { - methods: [ - { - authentication_method: 0, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 1, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 2, - provider: "https://kudos.demo.anastasis.lu/", - }, - ], - }, - { - methods: [ - { - authentication_method: 0, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 1, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 3, - provider: "https://anastasis.demo.taler.net/", - }, - ], - }, - { - methods: [ - { - authentication_method: 0, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 1, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 4, - provider: "https://anastasis.demo.taler.net/", - }, - ], - }, - { - methods: [ - { - authentication_method: 0, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 2, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 3, - provider: "https://anastasis.demo.taler.net/", - }, - ], - }, - { - methods: [ - { - authentication_method: 0, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 2, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 4, - provider: "https://anastasis.demo.taler.net/", - }, - ], - }, - { - methods: [ - { - authentication_method: 0, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 3, - provider: "https://anastasis.demo.taler.net/", - }, - { - authentication_method: 4, - provider: "https://anastasis.demo.taler.net/", - }, - ], - }, - { - methods: [ - { - authentication_method: 1, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 2, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 3, - provider: "https://anastasis.demo.taler.net/", - }, - ], - }, - { - methods: [ - { - authentication_method: 1, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 2, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 4, - provider: "https://anastasis.demo.taler.net/", - }, - ], - }, - { - methods: [ - { - authentication_method: 1, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 3, - provider: "https://anastasis.demo.taler.net/", - }, - { - authentication_method: 4, - provider: "https://anastasis.demo.taler.net/", - }, - ], - }, - { - methods: [ - { - authentication_method: 2, - provider: "https://kudos.demo.anastasis.lu/", - }, - { - authentication_method: 3, - provider: "https://anastasis.demo.taler.net/", - }, - { - authentication_method: 4, - provider: "https://anastasis.demo.taler.net/", - }, - ], - }, - ], - authentication_methods: [ - { - type: "email", - instructions: "Email to qwe@asd.com", - challenge: "E5VPA", - }, - { - type: "sms", - instructions: "SMS to 555-555", - challenge: "", - }, - { - type: "question", - instructions: "Does P equal NP?", - challenge: "C5SP8", - }, - { - type: "totp", - instructions: "Response code for 'Anastasis'", - challenge: "E5VPA", - }, - { - type: "sms", - instructions: "SMS to 6666-6666", - challenge: "", - }, - { - type: "question", - instructions: "How did the chicken cross the road?", - challenge: "C5SP8", - }, - ], -} as ReducerState); +export const SomePoliciesWithMethods = tests.createExample( + TestedComponent, + {}, + { + ...reducerStatesExample.policyReview, + policies: [ + { + methods: [ + { + authentication_method: 0, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 1, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 2, + provider: "https://kudos.demo.anastasis.lu/", + }, + ], + }, + { + methods: [ + { + authentication_method: 0, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 1, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 3, + provider: "https://anastasis.demo.taler.net/", + }, + ], + }, + { + methods: [ + { + authentication_method: 0, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 1, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 4, + provider: "https://anastasis.demo.taler.net/", + }, + ], + }, + { + methods: [ + { + authentication_method: 0, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 2, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 3, + provider: "https://anastasis.demo.taler.net/", + }, + ], + }, + { + methods: [ + { + authentication_method: 0, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 2, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 4, + provider: "https://anastasis.demo.taler.net/", + }, + ], + }, + { + methods: [ + { + authentication_method: 0, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 3, + provider: "https://anastasis.demo.taler.net/", + }, + { + authentication_method: 4, + provider: "https://anastasis.demo.taler.net/", + }, + ], + }, + { + methods: [ + { + authentication_method: 1, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 2, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 3, + provider: "https://anastasis.demo.taler.net/", + }, + ], + }, + { + methods: [ + { + authentication_method: 1, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 2, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 4, + provider: "https://anastasis.demo.taler.net/", + }, + ], + }, + { + methods: [ + { + authentication_method: 1, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 3, + provider: "https://anastasis.demo.taler.net/", + }, + { + authentication_method: 4, + provider: "https://anastasis.demo.taler.net/", + }, + ], + }, + { + methods: [ + { + authentication_method: 2, + provider: "https://kudos.demo.anastasis.lu/", + }, + { + authentication_method: 3, + provider: "https://anastasis.demo.taler.net/", + }, + { + authentication_method: 4, + provider: "https://anastasis.demo.taler.net/", + }, + ], + }, + ], + authentication_methods: [ + { + type: "email", + instructions: "Email to qwe@asd.com", + challenge: "E5VPA", + }, + { + type: "sms", + instructions: "SMS to 555-555", + challenge: "", + }, + { + type: "question", + instructions: "Does P equal NP?", + challenge: "C5SP8", + }, + { + type: "totp", + instructions: "Response code for 'Anastasis'", + challenge: "E5VPA", + }, + { + type: "sms", + instructions: "SMS to 6666-6666", + challenge: "", + }, + { + type: "question", + instructions: "How did the chicken cross the road?", + challenge: "C5SP8", + }, + ], + } as ReducerState, +); |