@@ -15,6 +15,7 @@ import Tutorial from 'docc-render/components/Tutorial.vue';
15
15
import SectionList from 'docc-render/components/Tutorial/SectionList.vue' ;
16
16
import NavigationBar from 'docc-render/components/Tutorial/NavigationBar.vue' ;
17
17
import TopicStore from 'docc-render/stores/TopicStore' ;
18
+ import AppStore from 'docc-render/stores/AppStore' ;
18
19
19
20
const { Section, BreakpointEmitter, PortalTarget } = Tutorial . components ;
20
21
@@ -239,6 +240,36 @@ describe('Tutorial', () => {
239
240
expect ( target . exists ( ) ) . toBe ( true ) ;
240
241
expect ( target . props ( ) ) . toHaveProperty ( 'name' , 'modal-destination' ) ;
241
242
} ) ;
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
+ } ) ;
242
273
} ) ;
243
274
244
275
describe ( 'Tutorial without hero section' , ( ) => {
0 commit comments