@@ -15,6 +15,7 @@ import Tutorial from 'docc-render/components/Tutorial.vue';
1515import SectionList from 'docc-render/components/Tutorial/SectionList.vue' ;
1616import NavigationBar from 'docc-render/components/Tutorial/NavigationBar.vue' ;
1717import TopicStore from 'docc-render/stores/TopicStore' ;
18+ import AppStore from 'docc-render/stores/AppStore' ;
1819
1920const { Section, BreakpointEmitter, PortalTarget } = Tutorial . components ;
2021
@@ -239,6 +240,36 @@ describe('Tutorial', () => {
239240 expect ( target . exists ( ) ) . toBe ( true ) ;
240241 expect ( target . props ( ) ) . toHaveProperty ( 'name' , 'modal-destination' ) ;
241242 } ) ;
243+
244+ it ( 'sets available langs/locales' , async ( ) => {
245+ const locales = [ 'en-US' , 'ja-JP' ] ;
246+ const langs = [ 'en' , 'jp' ] ;
247+
248+ await wrapper . setProps ( {
249+ metadata : {
250+ ...propsData . metadata ,
251+ availableLocales : locales ,
252+ } ,
253+ } ) ;
254+ expect ( AppStore . state . availableLocales ) . toEqual ( locales ) ;
255+
256+ await wrapper . setProps ( {
257+ metadata : {
258+ ...propsData . metadata ,
259+ availableLanguages : langs ,
260+ } ,
261+ } ) ;
262+ expect ( AppStore . state . availableLocales ) . toEqual ( langs ) ;
263+
264+ await wrapper . setProps ( {
265+ metadata : {
266+ ...propsData . metadata ,
267+ availableLanguages : langs ,
268+ availableLocales : locales ,
269+ } ,
270+ } ) ;
271+ expect ( AppStore . state . availableLocales ) . toEqual ( langs ) ;
272+ } ) ;
242273} ) ;
243274
244275describe ( 'Tutorial without hero section' , ( ) => {
0 commit comments