Created
July 20, 2021 13:08
-
-
Save jodyheavener/a710e06315753cef26d045ac8877f0cf to your computer and use it in GitHub Desktop.
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
diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/cadReminder/index.stories.ts b/packages/fxa-auth-server/lib/senders/emails/templates/cadReminder/index.stories.ts | |
index 83093dc46..7f56440df 100644 | |
--- a/packages/fxa-auth-server/lib/senders/emails/templates/cadReminder/index.stories.ts | |
+++ b/packages/fxa-auth-server/lib/senders/emails/templates/cadReminder/index.stories.ts | |
@@ -9,7 +9,12 @@ export default { | |
title: 'Emails/cadReminder', | |
} as Meta; | |
-const Template: Story<StorybookEmailArgs> = (args) => storybookEmail(args); | |
+function createEmailTemplate(name: string, args: StorybookEmailArgs) { | |
+ const story = (args: StorybookEmailArgs) => storybookEmail(args); | |
+ story.storyName = name; | |
+ story.args = args; | |
+ return story; | |
+} | |
const defaultVariables = { | |
buttonText: 'Sync another device', | |
@@ -39,14 +44,16 @@ const commonPropsWithOverrides = ( | |
}, | |
}); | |
-export const CadReminderDesktopTablet = Template.bind({}); | |
-CadReminderDesktopTablet.args = commonPropsWithOverrides({ | |
- onDesktopOrTabletDevice: true, | |
-}); | |
-CadReminderDesktopTablet.storyName = 'User is on desktop or tablet device'; | |
+export const CadReminderDesktopTablet = createEmailTemplate( | |
+ 'User is on desktop or tablet device', | |
+ commonPropsWithOverrides({ | |
+ onDesktopOrTabletDevice: true, | |
+ }) | |
+); | |
-export const CadReminderMobile = Template.bind({}); | |
-CadReminderMobile.args = commonPropsWithOverrides({ | |
- onDesktopOrTabletDevice: false, | |
-}); | |
-CadReminderMobile.storyName = 'User is on mobile device'; | |
+export const CadReminderMobile = createEmailTemplate( | |
+ 'User is on mobile device', | |
+ commonPropsWithOverrides({ | |
+ onDesktopOrTabletDevice: false, | |
+ }) | |
+); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment