-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1344 from guardian/tier-three
Add Tier Three product
- Loading branch information
Showing
14 changed files
with
289 additions
and
7 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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,73 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { rest } from 'msw'; | ||
import { ReactRouterDecorator } from '@/.storybook/ReactRouterDecorator'; | ||
import { PRODUCT_TYPES } from '@/shared/productTypes'; | ||
import { existingHolidays } from '../../../fixtures/holidays'; | ||
import { toMembersDataApiResponse } from '../../../fixtures/mdapiResponse'; | ||
import { | ||
guardianWeeklyPaidByCard, | ||
tierThree, | ||
} from '../../../fixtures/productBuilder/testProducts'; | ||
import { HolidayDateChooser } from './HolidayDateChooser'; | ||
import { HolidaysOverview } from './HolidaysOverview'; | ||
import { HolidayStopsContainer } from './HolidayStopsContainer'; | ||
|
||
const productTypeWithHolidayStops = { | ||
...PRODUCT_TYPES.tierthree, | ||
holidayStops: { | ||
issueKeyword: 'issue', | ||
}, | ||
}; | ||
|
||
export default { | ||
component: HolidayStopsContainer, | ||
title: 'Pages/HolidayStops', | ||
decorators: [ReactRouterDecorator], | ||
parameters: { | ||
reactRouter: { | ||
container: ( | ||
<HolidayStopsContainer | ||
productType={productTypeWithHolidayStops} | ||
/> | ||
), | ||
}, | ||
}, | ||
} as Meta<typeof HolidayStopsContainer>; | ||
|
||
export const ManageTierThree: StoryObj<typeof HolidaysOverview> = { | ||
render: () => { | ||
return <HolidaysOverview />; | ||
}, | ||
|
||
parameters: { | ||
msw: [ | ||
rest.get('/api/me/mma', (_req, res, ctx) => { | ||
return res(ctx.json(toMembersDataApiResponse(tierThree()))); | ||
}), | ||
rest.get('/api/holidays/*', (_req, res, ctx) => { | ||
return res(ctx.json(existingHolidays)); | ||
}), | ||
], | ||
}, | ||
}; | ||
|
||
export const CreateTierThree: StoryObj<typeof HolidayDateChooser> = { | ||
render: () => { | ||
return <HolidayDateChooser />; | ||
}, | ||
|
||
parameters: { | ||
msw: [ | ||
rest.get('/api/me/mma', (_req, res, ctx) => { | ||
return res( | ||
ctx.json( | ||
toMembersDataApiResponse(guardianWeeklyPaidByCard()), | ||
), | ||
); | ||
}), | ||
rest.get('/api/holidays/*', (_req, res, ctx) => { | ||
return res(ctx.json(existingHolidays)); | ||
}), | ||
], | ||
}, | ||
}; |
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
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
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
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
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
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
Oops, something went wrong.