Skip to content

Commit 216def9

Browse files
authored
Merge pull request code-dot-org#24848 from code-dot-org/delete-teacher-acct-story
Add storybook stories for delete account dialog
2 parents c9f995f + 00111c6 commit 216def9

File tree

1 file changed

+45
-3
lines changed

1 file changed

+45
-3
lines changed

apps/src/lib/ui/accounts/DeleteAccountDialog.story.jsx

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import DeleteAccountDialog from './DeleteAccountDialog';
33
import {action} from '@storybook/addon-actions';
4+
import {getCheckboxes} from './DeleteAccountHelpers';
45

56
const PASSWORD = 'MY_PASSWORD';
67
const DELETE_VERIFICATION = 'DELETE MY ACCOUNT';
@@ -35,16 +36,57 @@ export default storybook => {
3536
)
3637
},
3738
{
38-
name: 'Delete Teacher Account',
39-
description: 'Warning message for teacher account deletion',
39+
name: 'Delete Teacher Account - without students',
40+
description: 'Warning message for teacher account deletion.',
41+
story: () => (
42+
<DeleteAccountDialog
43+
{...DEFAULT_PROPS}
44+
isTeacher={true}
45+
warnAboutDeletingStudents={false}
46+
/>
47+
)
48+
},
49+
{
50+
name: 'Delete Teacher Account - with students',
51+
description: 'Warning message for teacher account deletion.',
52+
story: () => (
53+
<DeleteAccountDialog
54+
{...DEFAULT_PROPS}
55+
isTeacher={true}
56+
warnAboutDeletingStudents={true}
57+
/>
58+
)
59+
},
60+
{
61+
name: 'Delete Teacher Account with students - 1 checkbox visible',
62+
description: `
63+
A teacher with students is only required to see/check
64+
the first checkbox to delete their account.
65+
`,
66+
story: () => (
67+
<DeleteAccountDialog
68+
{...DEFAULT_PROPS}
69+
isTeacher={true}
70+
warnAboutDeletingStudents={true}
71+
checkboxes={getCheckboxes(false,true)}
72+
/>
73+
)
74+
},
75+
{
76+
name: 'Delete Teacher Account with students - 5 checkboxes visible',
77+
description: `
78+
For a teacher that has students who depend on them to log in
79+
and is required to see/check all 5 checkboxes to delete their
80+
account.
81+
`,
4082
story: () => (
4183
<DeleteAccountDialog
4284
{...DEFAULT_PROPS}
4385
isTeacher={true}
4486
warnAboutDeletingStudents={true}
87+
checkboxes={getCheckboxes(true)}
4588
/>
4689
)
4790
},
4891
]);
4992
};
50-

0 commit comments

Comments
 (0)