@@ -180,19 +180,34 @@ describe('App', () => {
180
180
expect ( wrapper . find ( LocaleSelector ) . exists ( ) ) . toBe ( false ) ;
181
181
} ) ;
182
182
183
- it ( 'renders the `#nav-sticky-anchor` between the header and the content ' , ( ) => {
183
+ it ( 'renders the `#nav-sticky-anchor` between the header and loading placeholder ' , ( ) => {
184
184
const wrapper = createWrapper ( {
185
185
slots : {
186
186
header : '<div class="header">Footer</div>' ,
187
- default : '<div class="default">Default</div>' ,
188
187
} ,
189
188
} ) ;
190
189
const header = wrapper . find ( '.header' ) ;
191
- const content = wrapper . find ( '.default' ) ;
192
190
const stickyAnchor = wrapper . find ( `#${ baseNavStickyAnchorId } ` ) ;
191
+ const loadingPlaceholder = wrapper . find ( InitialLoadingPlaceholder ) ;
192
+
193
193
// make sure the anchor is below the header and above the content
194
194
expect ( header . element . nextElementSibling ) . toBe ( stickyAnchor . element ) ;
195
- expect ( stickyAnchor . element . nextElementSibling ) . toBe ( content . element ) ;
195
+ expect ( stickyAnchor . element . nextElementSibling ) . toBe ( loadingPlaceholder . element ) ;
196
+ } ) ;
197
+
198
+ it ( 'renders an `InitialLoadingPlaceholder` between the anchor and the content' , ( ) => {
199
+ const wrapper = createWrapper ( {
200
+ slots : {
201
+ default : '<div class="default">Default</div>' ,
202
+ } ,
203
+ } ) ;
204
+ const stickyAnchor = wrapper . find ( `#${ baseNavStickyAnchorId } ` ) ;
205
+ const content = wrapper . find ( '.default' ) ;
206
+ const placeholder = wrapper . find ( InitialLoadingPlaceholder ) ;
207
+ // make sure the anchor is below the header and above the content
208
+ expect ( placeholder . exists ( ) ) . toBe ( true ) ;
209
+ expect ( stickyAnchor . element . nextElementSibling ) . toBe ( placeholder . element ) ;
210
+ expect ( placeholder . element . nextElementSibling ) . toBe ( content . element ) ;
196
211
} ) ;
197
212
198
213
it ( 'exposes a footer slot' , ( ) => {
@@ -216,12 +231,6 @@ describe('App', () => {
216
231
expect ( wrapper . find ( 'router-view-stub' ) . exists ( ) ) . toBe ( false ) ;
217
232
} ) ;
218
233
219
- it ( 'renders an `InitialLoadingPlaceholder`' , ( ) => {
220
- const wrapper = createWrapper ( ) ;
221
-
222
- expect ( wrapper . find ( InitialLoadingPlaceholder ) . exists ( ) ) . toBe ( true ) ;
223
- } ) ;
224
-
225
234
it ( 'renders a default `Footer` for non-IDE targets' , ( ) => {
226
235
const wrapper = createWrapper ( ) ;
227
236
expect ( wrapper . contains ( Footer ) ) . toBe ( true ) ;
0 commit comments