11import { setupWorker } from "msw" ;
2+ import { withReactIntl } from "storybook-react-intl/dist/cjs/withReactIntl" ;
3+
24import locationFieldHandlers from "../packages/location-field/src/mocks/handlers" ;
3- import itineraryBodyHandlers from ' ../packages/itinerary-body/src/__mocks__/handlers'
5+ import itineraryBodyHandlers from " ../packages/itinerary-body/src/__mocks__/handlers" ;
46import geocoderHandlers from "../packages/geocoder/src/test-fixtures/handlers" ;
57
8+ import { reactIntl } from './react-intl.js' ;
9+
610// Only install worker when running in browser
7- if ( typeof global . process === ' undefined' ) {
11+ if ( typeof global . process === " undefined" ) {
812 const worker = setupWorker (
913 ...locationFieldHandlers ,
1014 ...itineraryBodyHandlers ,
1115 ...geocoderHandlers
1216 ) ;
13- worker . start ( { onUnhandledRequest : "bypass" } )
17+ worker . start ( { onUnhandledRequest : "bypass" } ) ;
1418}
1519
16-
1720export const parameters = {
1821 a11y : {
1922 config : {
2023 rules : [
2124 {
2225 // moved to technical backlog
23- id : ' aria-required-parent' ,
26+ id : " aria-required-parent" ,
2427 reviewOnFail : true ,
2528 } ,
2629 {
2730 // Appears to be a story bug
28- id : ' duplicate-id' ,
31+ id : " duplicate-id" ,
2932 reviewOnFail : true
3033 } ,
3134 {
3235 // Appears to be a story bug
33- id : ' duplicate-id-aria' ,
36+ id : " duplicate-id-aria" ,
3437 reviewOnFail : true
3538 }
3639 ] ,
@@ -43,4 +46,16 @@ export const parameters = {
4346 date : / D a t e $ / ,
4447 } ,
4548 } ,
46- }
49+ locale : reactIntl . defaultLocale ,
50+ locales : {
51+ "en-US" : { title : "English (US)" , left : "🇺🇸" } ,
52+ fr : { title : "Français" , left : "🇫🇷" } ,
53+ unknown : { title : "Unknown" , left : "🚫" }
54+ } ,
55+ reactIntl
56+ } ;
57+
58+ // Per https://www.npmjs.com/package/@storybook /addon-storyshots,
59+ // explicitly export the storybook-react-intl decorator
60+ // so it is included in jest snapshots.
61+ export const decorators = [ withReactIntl ] ;
0 commit comments