Skip to content

Commit

Permalink
Revert "httpCache.cy.js: retry 'invalidates /camp/{campId}/categories…
Browse files Browse the repository at this point in the history
… for new category' in runMode"

This reverts commit 1c9d51e.
  • Loading branch information
BacLuc committed Mar 2, 2025
1 parent ce3af9e commit 7f443fe
Showing 1 changed file with 30 additions and 34 deletions.
64 changes: 30 additions & 34 deletions e2e/specs/httpCache.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,41 +141,37 @@ describe('HTTP cache tests', () => {
})
})

it(
'invalidates /camp/{campId}/categories for new category',
{ retries: { runMode: 3 } },
() => {
const uri = '/api/camps/3c79b99ab424/categories'

Cypress.session.clearAllSavedSessions()
cy.login('test@example.com')
.then(() => cy.expectCacheMiss(uri))
.then(() => cy.expectCacheHit(uri))
.then(() =>
cy.apiPost('/api/categories', {
camp: '/api/camps/3c79b99ab424',
short: 'new',
name: 'new Category',
color: '#000000',
numberingStyle: '1',
})
)
.then((response) => {
// add new category to camp
const newContentNodeUri = response.body._links.self.href

// ensure cache was invalidated
cy.expectCacheMiss(uri)
cy.expectCacheHit(uri)

// delete newly created contentNode
cy.apiDelete(newContentNodeUri)

// ensure cache was invalidated
cy.expectCacheMiss(uri)
it('invalidates /camp/{campId}/categories for new category', () => {
const uri = '/api/camps/3c79b99ab424/categories'

Cypress.session.clearAllSavedSessions()
cy.login('test@example.com')
.then(() => cy.expectCacheMiss(uri))
.then(() => cy.expectCacheHit(uri))
.then(() =>
cy.apiPost('/api/categories', {
camp: '/api/camps/3c79b99ab424',
short: 'new',
name: 'new Category',
color: '#000000',
numberingStyle: '1',
})
}
)
)
.then((response) => {
// add new category to camp
const newContentNodeUri = response.body._links.self.href

// ensure cache was invalidated
cy.expectCacheMiss(uri)
cy.expectCacheHit(uri)

// delete newly created contentNode
cy.apiDelete(newContentNodeUri)

// ensure cache was invalidated
cy.expectCacheMiss(uri)
})
})

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

0 comments on commit 7f443fe

Please # to comment.