Skip to content

Commit 4943e54

Browse files
authored
Merge pull request #6260 from BacLuc/retry-cache-test
httpCache.cy.js: retry 'invalidates /camp/{campId}/categories for new category' in runMode
2 parents 487c054 + 1c9d51e commit 4943e54

File tree

1 file changed

+30
-26
lines changed

1 file changed

+30
-26
lines changed

e2e/specs/httpCache.cy.js

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -141,37 +141,41 @@ describe('HTTP cache tests', () => {
141141
})
142142
})
143143

144-
it('invalidates /camp/{campId}/categories for new category', () => {
145-
const uri = '/api/camps/3c79b99ab424/categories'
146-
147-
Cypress.session.clearAllSavedSessions()
148-
cy.login('[email protected]')
149-
150-
// warm up cache
151-
cy.expectCacheMiss(uri)
152-
cy.expectCacheHit(uri)
144+
it(
145+
'invalidates /camp/{campId}/categories for new category',
146+
{ retries: { runMode: 3 } },
147+
() => {
148+
const uri = '/api/camps/3c79b99ab424/categories'
153149

154-
// add new category to camp
155-
cy.apiPost('/api/categories', {
156-
camp: '/api/camps/3c79b99ab424',
157-
short: 'new',
158-
name: 'new Category',
159-
color: '#000000',
160-
numberingStyle: '1',
161-
}).then((response) => {
162-
const newContentNodeUri = response.body._links.self.href
150+
Cypress.session.clearAllSavedSessions()
151+
cy.login('[email protected]')
163152

164-
// ensure cache was invalidated
153+
// warm up cache
165154
cy.expectCacheMiss(uri)
166155
cy.expectCacheHit(uri)
167156

168-
// delete newly created contentNode
169-
cy.apiDelete(newContentNodeUri)
170-
171-
// ensure cache was invalidated
172-
cy.expectCacheMiss(uri)
173-
})
174-
})
157+
// add new category to camp
158+
cy.apiPost('/api/categories', {
159+
camp: '/api/camps/3c79b99ab424',
160+
short: 'new',
161+
name: 'new Category',
162+
color: '#000000',
163+
numberingStyle: '1',
164+
}).then((response) => {
165+
const newContentNodeUri = response.body._links.self.href
166+
167+
// ensure cache was invalidated
168+
cy.expectCacheMiss(uri)
169+
cy.expectCacheHit(uri)
170+
171+
// delete newly created contentNode
172+
cy.apiDelete(newContentNodeUri)
173+
174+
// ensure cache was invalidated
175+
cy.expectCacheMiss(uri)
176+
})
177+
}
178+
)
175179

176180
it('invalidates cached data when user leaves a camp', () => {
177181
Cypress.session.clearAllSavedSessions()

0 commit comments

Comments
 (0)