-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6283 from ecamp/devel
devel -> stage
- Loading branch information
Showing
3 changed files
with
39 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,37 +141,41 @@ describe('HTTP cache tests', () => { | |
}) | ||
}) | ||
|
||
it('invalidates /camp/{campId}/categories for new category', () => { | ||
const uri = '/api/camps/3c79b99ab424/categories' | ||
|
||
Cypress.session.clearAllSavedSessions() | ||
cy.login('[email protected]') | ||
|
||
// warm up cache | ||
cy.expectCacheMiss(uri) | ||
cy.expectCacheHit(uri) | ||
it( | ||
'invalidates /camp/{campId}/categories for new category', | ||
{ retries: { runMode: 3 } }, | ||
() => { | ||
const uri = '/api/camps/3c79b99ab424/categories' | ||
|
||
// 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 | ||
Cypress.session.clearAllSavedSessions() | ||
cy.login('[email protected]') | ||
|
||
// ensure cache was invalidated | ||
// warm up cache | ||
cy.expectCacheMiss(uri) | ||
cy.expectCacheHit(uri) | ||
|
||
// delete newly created contentNode | ||
cy.apiDelete(newContentNodeUri) | ||
|
||
// ensure cache was invalidated | ||
cy.expectCacheMiss(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 | ||
|
||
// 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() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters