@@ -88,12 +88,11 @@ describe(`navigation`, () => {
88
88
cy . get ( `h1` ) . invoke ( `text` ) . should ( `eq` , `Gatsby.js development 404 page` )
89
89
90
90
/*
91
- * Three route updates:
91
+ * Two route updates:
92
92
* - initial render of /
93
- * - render overlays
94
93
* - (default) development 404 page
95
94
*/
96
- cy . lifecycleCallCount ( `onRouteUpdate` ) . should ( `eq` , 3 )
95
+ cy . lifecycleCallCount ( `onRouteUpdate` ) . should ( `eq` , 2 )
97
96
} )
98
97
99
98
it ( `can display a custom 404 page` , ( ) => {
@@ -102,13 +101,12 @@ describe(`navigation`, () => {
102
101
cy . getTestElement ( `page-title` ) . invoke ( `text` ) . should ( `eq` , `NOT FOUND` )
103
102
104
103
/*
105
- * Three route updates:
104
+ * Two route updates:
106
105
* - initial render
107
- * - render overlays
108
106
* - 404 page
109
107
* a re-render does not occur because the route remains the same
110
108
*/
111
- cy . lifecycleCallCount ( `onRouteUpdate` ) . should ( `eq` , 3 )
109
+ cy . lifecycleCallCount ( `onRouteUpdate` ) . should ( `eq` , 2 )
112
110
} )
113
111
} )
114
112
@@ -138,7 +136,7 @@ describe(`navigation`, () => {
138
136
} )
139
137
140
138
it ( `should show 404 page when url with unicode characters point to a non-existent page route when navigating on client` , ( ) => {
141
- cy . visit ( `/` ) . waitForRouteChange ( )
139
+ cy . visit ( `/` , { failOnStatusCode : false } ) . waitForRouteChange ( )
142
140
cy . window ( )
143
141
. then ( win => win . ___navigate ( `/안녕404/` ) )
144
142
. waitForRouteChange ( )
@@ -220,21 +218,21 @@ describe(`navigation`, () => {
220
218
221
219
describe ( `Route lifecycle update order` , ( ) => {
222
220
it ( `calls onPreRouteUpdate, render and onRouteUpdate the correct amount of times on route change` , ( ) => {
223
- cy . lifecycleCallCount ( `onPreRouteUpdate` ) . should ( `eq` , 2 )
221
+ cy . lifecycleCallCount ( `onPreRouteUpdate` ) . should ( `eq` , 1 )
224
222
cy . lifecycleCallCount ( `render` ) . should ( `eq` , 2 )
225
- cy . lifecycleCallCount ( `onRouteUpdate` ) . should ( `eq` , 2 )
223
+ cy . lifecycleCallCount ( `onRouteUpdate` ) . should ( `eq` , 1 )
226
224
cy . getTestElement ( `page-two` ) . click ( ) . waitForRouteChange ( )
227
225
cy . getTestElement ( `page-2-message` ) . should ( `exist` )
228
- cy . lifecycleCallCount ( `onPreRouteUpdate` ) . should ( `eq` , 3 )
226
+ cy . lifecycleCallCount ( `onPreRouteUpdate` ) . should ( `eq` , 2 )
229
227
cy . lifecycleCallCount ( `render` ) . should ( `eq` , 3 )
230
- cy . lifecycleCallCount ( `onRouteUpdate` ) . should ( `eq` , 3 )
228
+ cy . lifecycleCallCount ( `onRouteUpdate` ) . should ( `eq` , 2 )
231
229
} )
232
230
233
231
it ( `renders the component after onPreRouteUpdate on route change` , ( ) => {
234
232
cy . getTestElement ( `page-component` ) . should ( `exist` )
235
- cy . lifecycleCallCount ( `onPreRouteUpdate` ) . should ( `eq` , 2 )
233
+ cy . lifecycleCallCount ( `onPreRouteUpdate` ) . should ( `eq` , 1 )
236
234
cy . lifecycleCallCount ( `render` ) . should ( `eq` , 2 )
237
- cy . lifecycleCallCount ( `onRouteUpdate` ) . should ( `eq` , 2 )
235
+ cy . lifecycleCallCount ( `onRouteUpdate` ) . should ( `eq` , 1 )
238
236
cy . lifecycleCallOrder ( [
239
237
`onPreRouteUpdate` ,
240
238
`render` ,
@@ -250,9 +248,9 @@ describe(`navigation`, () => {
250
248
`render` ,
251
249
`onRouteUpdate` ,
252
250
] ) . should ( `eq` , true )
253
- cy . lifecycleCallCount ( `onPreRouteUpdate` ) . should ( `eq` , 3 )
251
+ cy . lifecycleCallCount ( `onPreRouteUpdate` ) . should ( `eq` , 2 )
254
252
cy . lifecycleCallCount ( `render` ) . should ( `eq` , 3 )
255
- cy . lifecycleCallCount ( `onRouteUpdate` ) . should ( `eq` , 3 )
253
+ cy . lifecycleCallCount ( `onRouteUpdate` ) . should ( `eq` , 2 )
256
254
} )
257
255
} )
258
256
} )
0 commit comments