diff options
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, +); |