@@ -2,21 +2,21 @@ describe('Static Routing', () => {
2
2
it ( 'renders correct page via SSR on a static route' , ( ) => {
3
3
cy . request ( '/getServerSideProps/static/' ) . then ( ( res ) => {
4
4
expect ( res . status ) . to . eq ( 200 )
5
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'ssr' )
5
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'ssr' )
6
6
expect ( res . body ) . to . contain ( 'Sleepy Hollow' )
7
7
} )
8
8
} )
9
9
it ( 'serves correct static file on a static route' , ( ) => {
10
10
cy . request ( '/getStaticProps/static/' ) . then ( ( res ) => {
11
11
expect ( res . status ) . to . eq ( 200 )
12
- expect ( res . headers ) . to . not . have . property ( 'x-render-mode' )
12
+ expect ( res . headers ) . to . not . have . property ( 'x-nf- render-mode' )
13
13
expect ( res . body ) . to . contain ( 'Dancing with the Stars' )
14
14
} )
15
15
} )
16
16
it ( 'renders correct page via ODB on a static route' , ( ) => {
17
17
cy . request ( '/getStaticProps/with-revalidate/' ) . then ( ( res ) => {
18
18
expect ( res . status ) . to . eq ( 200 )
19
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'odb ttl=60' )
19
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'odb ttl=60' )
20
20
expect ( res . body ) . to . contain ( 'Dancing with the Stars' )
21
21
} )
22
22
} )
@@ -26,101 +26,101 @@ describe('Dynamic Routing', () => {
26
26
it ( 'renders correct page via SSR on a dynamic route' , ( ) => {
27
27
cy . request ( '/getServerSideProps/1/' ) . then ( ( res ) => {
28
28
expect ( res . status ) . to . eq ( 200 )
29
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'ssr' )
29
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'ssr' )
30
30
expect ( res . body ) . to . contain ( 'Under the Dome' )
31
31
} )
32
32
} )
33
33
it ( 'renders correct page via SSR on a dynamic catch-all route' , ( ) => {
34
34
cy . request ( '/getServerSideProps/all/1/' ) . then ( ( res ) => {
35
35
expect ( res . status ) . to . eq ( 200 )
36
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'ssr' )
36
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'ssr' )
37
37
expect ( res . body ) . to . contain ( 'Under the Dome' )
38
38
} )
39
39
} )
40
40
it ( 'serves correct static file on a prerendered dynamic route with fallback: false' , ( ) => {
41
41
cy . request ( '/getStaticProps/1/' ) . then ( ( res ) => {
42
42
expect ( res . status ) . to . eq ( 200 )
43
- expect ( res . headers ) . to . not . have . property ( 'x-render-mode' )
43
+ expect ( res . headers ) . to . not . have . property ( 'x-nf- render-mode' )
44
44
expect ( res . body ) . to . contain ( 'Under the Dome' )
45
45
} )
46
46
} )
47
47
it ( 'renders custom 404 on a non-prerendered dynamic route with fallback: false' , ( ) => {
48
48
cy . request ( { url : '/getStaticProps/3/' , failOnStatusCode : false } ) . then ( ( res ) => {
49
49
expect ( res . status ) . to . eq ( 404 )
50
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'odb' )
50
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'odb' )
51
51
expect ( res . body ) . to . contain ( 'Custom 404' )
52
52
} )
53
53
} )
54
54
it ( 'serves correct static file on a prerendered dynamic route with fallback: true' , ( ) => {
55
55
cy . request ( '/getStaticProps/withFallback/1/' ) . then ( ( res ) => {
56
56
expect ( res . status ) . to . eq ( 200 )
57
- expect ( res . headers ) . to . not . have . property ( 'x-render-mode' )
57
+ expect ( res . headers ) . to . not . have . property ( 'x-nf- render-mode' )
58
58
expect ( res . body ) . to . contain ( 'Under the Dome' )
59
59
} )
60
60
} )
61
61
it ( 'renders fallback page via ODB on a non-prerendered dynamic route with fallback: true' , ( ) => {
62
62
cy . request ( '/getStaticProps/withFallback/3/' ) . then ( ( res ) => {
63
63
expect ( res . status ) . to . eq ( 200 )
64
64
// expect 'odb' until https://github.com/netlify/pillar-runtime/issues/438 is fixed
65
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'odb' )
65
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'odb' )
66
66
// expect 'Bitten' until the above is fixed and we can test for fallback 'Loading...' message
67
67
expect ( res . body ) . to . contain ( 'Bitten' )
68
68
} )
69
69
} )
70
70
it ( 'serves correct static file on a prerendered dynamic route with fallback: blocking' , ( ) => {
71
71
cy . request ( '/getStaticProps/withFallbackBlocking/1/' ) . then ( ( res ) => {
72
72
expect ( res . status ) . to . eq ( 200 )
73
- expect ( res . headers ) . to . not . have . property ( 'x-render-mode' )
73
+ expect ( res . headers ) . to . not . have . property ( 'x-nf- render-mode' )
74
74
expect ( res . body ) . to . contain ( 'Under the Dome' )
75
75
} )
76
76
} )
77
77
it ( 'renders correct page via ODB on a non-prerendered dynamic route with fallback: blocking' , ( ) => {
78
78
cy . request ( '/getStaticProps/withFallbackBlocking/3/' ) . then ( ( res ) => {
79
79
expect ( res . status ) . to . eq ( 200 )
80
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'odb' )
80
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'odb' )
81
81
expect ( res . body ) . to . contain ( 'Bitten' )
82
82
} )
83
83
} )
84
84
it ( 'renders correct page via ODB on a prerendered dynamic route with revalidate and fallback: false' , ( ) => {
85
85
cy . request ( '/getStaticProps/withRevalidate/1/' ) . then ( ( res ) => {
86
86
expect ( res . status ) . to . eq ( 200 )
87
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'odb ttl=60' )
87
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'odb ttl=60' )
88
88
expect ( res . body ) . to . contain ( 'Under the Dome' )
89
89
} )
90
90
} )
91
91
it ( 'renders custom 404 on a non-prerendered dynamic route with revalidate and fallback: false' , ( ) => {
92
92
cy . request ( { url : '/getStaticProps/withRevalidate/3/' , failOnStatusCode : false } ) . then ( ( res ) => {
93
93
expect ( res . status ) . to . eq ( 404 )
94
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'odb' )
94
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'odb' )
95
95
expect ( res . body ) . to . contain ( 'Custom 404' )
96
96
} )
97
97
} )
98
98
it ( 'renders correct page via ODB on a prerendered dynamic route with revalidate and fallback: true' , ( ) => {
99
99
cy . request ( '/getStaticProps/withRevalidate/withFallback/1/' ) . then ( ( res ) => {
100
100
expect ( res . status ) . to . eq ( 200 )
101
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'odb ttl=60' )
101
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'odb ttl=60' )
102
102
expect ( res . body ) . to . contain ( 'Under the Dome' )
103
103
} )
104
104
} )
105
105
it ( 'renders fallback page via ODB on a non-prerendered dynamic route with revalidate and fallback: true' , ( ) => {
106
106
cy . request ( '/getStaticProps/withRevalidate/withFallback/3/' ) . then ( ( res ) => {
107
107
expect ( res . status ) . to . eq ( 200 )
108
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'odb ttl=60' )
108
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'odb ttl=60' )
109
109
// expect 'Bitten' until https://github.com/netlify/pillar-runtime/issues/438 is fixed
110
110
expect ( res . body ) . to . contain ( 'Bitten' )
111
111
} )
112
112
} )
113
113
it ( 'renders correct page via ODB on a prerendered dynamic route with revalidate and fallback: blocking' , ( ) => {
114
114
cy . request ( '/getStaticProps/withRevalidate/withFallbackBlocking/1/' ) . then ( ( res ) => {
115
115
expect ( res . status ) . to . eq ( 200 )
116
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'odb ttl=60' )
116
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'odb ttl=60' )
117
117
expect ( res . body ) . to . contain ( 'Under the Dome' )
118
118
} )
119
119
} )
120
120
it ( 'renders correct page via ODB on a non-prerendered dynamic route with revalidate and fallback: blocking' , ( ) => {
121
121
cy . request ( '/getStaticProps/withRevalidate/withFallbackBlocking/3/' ) . then ( ( res ) => {
122
122
expect ( res . status ) . to . eq ( 200 )
123
- expect ( res . headers ) . to . have . property ( 'x-render-mode' , 'odb ttl=60' )
123
+ expect ( res . headers ) . to . have . property ( 'x-nf- render-mode' , 'odb ttl=60' )
124
124
expect ( res . body ) . to . contain ( 'Bitten' )
125
125
} )
126
126
} )
0 commit comments