Skip to content

Commit

Permalink
wait for login
Browse files Browse the repository at this point in the history
  • Loading branch information
BacLuc committed Mar 2, 2025
1 parent 8decac9 commit 695d9db
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions e2e/specs/httpCache.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,33 +144,34 @@ describe('HTTP cache tests', () => {
it('invalidates /camp/{campId}/categories for new category', () => {
const uri = '/api/camps/3c79b99ab424/categories'

Cypress.session.clearAllSavedSessions()
cy.login('test@example.com')
Cypress.session
.clearAllSavedSessions()
.then(() => 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

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

// add new category to camp
cy.apiPost('/api/categories', {
camp: '/api/camps/3c79b99ab424',
short: 'new',
name: 'new Category',
color: '#000000',
numberingStyle: '1',
}).then((response) => {
const newContentNodeUri = response.body._links.self.href
// delete newly created contentNode
cy.apiDelete(newContentNodeUri)

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

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

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

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

0 comments on commit 695d9db

Please # to comment.