File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1414 class =" navigator"
1515 >
1616 <NavigatorCard
17- v-if =" !isFetching"
17+ v-show =" !isFetching"
1818 v-bind =" technologyProps"
1919 :type =" type"
2020 :children =" flatChildren"
3333 </NavigatorCard >
3434 <LoadingNavigatorCard
3535 @close =" $emit('close')"
36- v-else
36+ v-if = " isFetching "
3737 />
3838 <div aria-live =" polite" class =" visuallyhidden" >
3939 {{ $t('navigator.navigator-is', {
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ import { INDEX_ROOT_KEY } from '@/constants/sidebar';
1717
1818jest . mock ( 'docc-render/utils/throttle' , ( ) => jest . fn ( v => v ) ) ;
1919
20+ const { LoadingNavigatorCard } = Navigator . components ;
21+
2022const technology = {
2123 title : 'FooTechnology' ,
2224 children : [
@@ -161,6 +163,24 @@ describe('Navigator', () => {
161163 expect ( wrapper . find ( '[aria-live="polite"]' ) . text ( ) ) . toBe ( 'navigator.navigator-is navigator.state.loading' ) ;
162164 } ) ;
163165
166+ it ( 'renders a LoadingNavigatorCard when navigator is loading' , ( ) => {
167+ const wrapper = createWrapper ( {
168+ propsData : {
169+ isFetching : true ,
170+ } ,
171+ } ) ;
172+ expect ( wrapper . find ( LoadingNavigatorCard ) . exists ( ) ) . toBe ( true ) ;
173+ } ) ;
174+
175+ it ( 'adds display:none to NavigatorCard when navigator is loading' , ( ) => {
176+ const wrapper = createWrapper ( {
177+ propsData : {
178+ isFetching : true ,
179+ } ,
180+ } ) ;
181+ expect ( wrapper . find ( NavigatorCard ) . attributes ( 'style' ) ) . toContain ( 'display: none' ) ;
182+ } ) ;
183+
164184 it ( 'renders an aria live that tells VO users when navigator is ready' , ( ) => {
165185 const wrapper = createWrapper ( ) ;
166186 expect ( wrapper . find ( '[aria-live="polite"]' ) . exists ( ) ) . toBe ( true ) ;
You can’t perform that action at this time.
0 commit comments