Skip to content

Commit 47deaff

Browse files
authored
Sometimes CSS interception works, sometimes does not (#573)
1 parent 05fc2d3 commit 47deaff

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/stubbing-spying__route2/cypress/integration/stub-fetch-spec.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,17 @@ describe('route2', () => {
183183
})
184184

185185
describe('CSS', () => {
186-
// NOTE: does it work? Sometimes it does, sometimes it does not
187-
it.skip('highlights LI elements using injected CSS', () => {
186+
it('highlights LI elements using injected CSS', () => {
188187
// let's intercept the stylesheet the application is loading
189188
// to highlight list items with a border
190189
cy.route2('styles.css', (req) => {
190+
// to avoid caching responses and the server responding
191+
// with nothing (because the resource has not changed)
192+
// and force the server to send the CSS file
193+
// delete caching headers from the request
194+
delete req.headers['if-modified-since']
195+
delete req.headers['if-none-match']
196+
191197
req.reply((res) => {
192198
res.send(`${res.body}
193199
li {

0 commit comments

Comments
 (0)