-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📝 [#3969] Stories for LoA overrides field
- Loading branch information
1 parent
8449799
commit dfbd6bb
Showing
2 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/openforms/js/components/admin/form_design/authentication/LoAOverrideOption.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {ArgTypes, Canvas, Meta} from '@storybook/addon-docs'; | ||
|
||
import LoAOverrideOption from './LoAOverrideOption'; | ||
import * as Stories from './LoAOverrideOption.stories'; | ||
|
||
<Meta of={Stories} /> | ||
|
||
# Form field | ||
|
||
Some authentication plugins offer the option of overriding the Level of Assurance (LoA) per form. | ||
This form field is visible if one of these plugins has been selected. It is then possible to select | ||
the new minimum desired LoA for a form. | ||
|
||
<Canvas of={Stories.Default} /> | ||
|
||
### Props | ||
|
||
<ArgTypes of={LoAOverrideOption} /> |
116 changes: 116 additions & 0 deletions
116
src/openforms/js/components/admin/form_design/authentication/LoAOverrideOption.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
import {expect} from '@storybook/jest'; | ||
import {within} from '@storybook/testing-library'; | ||
|
||
import LoAOverrideOption from './LoAOverrideOption'; | ||
|
||
export default { | ||
title: 'Form design/ Authentication / LoA override option', | ||
component: LoAOverrideOption, | ||
}; | ||
|
||
export const Default = { | ||
args: { | ||
availableAuthPlugins: [ | ||
{ | ||
id: 'digid', | ||
label: 'DigiD', | ||
providesAuth: 'bsn', | ||
supportsLoaOverride: true, | ||
assuranceLevels: [ | ||
{ | ||
value: 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport', | ||
label: 'DigiD Basis', | ||
}, | ||
{ | ||
value: 'urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract', | ||
label: 'DigiD Midden', | ||
}, | ||
{ | ||
value: 'urn:oasis:names:tc:SAML:2.0:ac:classes:Smartcard', | ||
label: 'DigiD Substantieel', | ||
}, | ||
{ | ||
value: 'urn:oasis:names:tc:SAML:2.0:ac:classes:SmartcardPKI', | ||
label: 'DigiD Hoog', | ||
}, | ||
], | ||
}, | ||
{ | ||
id: 'eidas', | ||
label: 'eIDAS', | ||
providesAuth: 'pseudo', | ||
supportsLoaOverride: false, | ||
assuranceLevels: [], | ||
}, | ||
], | ||
selectedAuthPlugins: ['digid', 'eidas'], | ||
authenticationBackendOptions: { | ||
digid: {loa: 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport'}, | ||
}, | ||
}, | ||
play: async ({canvasElement}) => { | ||
const canvas = within(canvasElement); | ||
|
||
const fieldLabel = canvas.queryByText('Minimale betrouwbaarheidsniveaus'); | ||
|
||
await expect(fieldLabel).toBeVisible(); | ||
|
||
const dropdowns = canvas.getAllByRole('combobox'); | ||
|
||
await expect(dropdowns.length).toEqual(1); | ||
}, | ||
}; | ||
|
||
export const NoDigiDSelected = { | ||
name: 'No DigiD selceted', | ||
args: { | ||
availableAuthPlugins: [ | ||
{ | ||
id: 'digid', | ||
label: 'DigiD', | ||
providesAuth: 'bsn', | ||
supportsLoaOverride: true, | ||
assuranceLevels: [ | ||
{ | ||
value: 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport', | ||
label: 'DigiD Basis', | ||
}, | ||
{ | ||
value: 'urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract', | ||
label: 'DigiD Midden', | ||
}, | ||
{ | ||
value: 'urn:oasis:names:tc:SAML:2.0:ac:classes:Smartcard', | ||
label: 'DigiD Substantieel', | ||
}, | ||
{ | ||
value: 'urn:oasis:names:tc:SAML:2.0:ac:classes:SmartcardPKI', | ||
label: 'DigiD Hoog', | ||
}, | ||
], | ||
}, | ||
{ | ||
id: 'eidas', | ||
label: 'eIDAS', | ||
providesAuth: 'pseudo', | ||
supportsLoaOverride: false, | ||
assuranceLevels: [], | ||
}, | ||
], | ||
selectedAuthPlugins: ['eidas'], | ||
authenticationBackendOptions: { | ||
digid: {loa: 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport'}, | ||
}, | ||
}, | ||
play: async ({canvasElement}) => { | ||
const canvas = within(canvasElement); | ||
|
||
const fieldLabel = canvas.queryByText('Minimale betrouwbaarheidsniveaus'); | ||
|
||
await expect(fieldLabel).toBeNull(); | ||
|
||
const dropdowns = canvas.queryAllByRole('combobox'); | ||
|
||
await expect(dropdowns.length).toEqual(0); | ||
}, | ||
}; |