Skip to content

Commit

Permalink
Merge pull request #6283 from ecamp/devel
Browse files Browse the repository at this point in the history
devel -> stage
  • Loading branch information
pmattmann authored Nov 5, 2024
2 parents 487c054 + 060ff81 commit e3ee046
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 26 deletions.
56 changes: 30 additions & 26 deletions e2e/specs/httpCache.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/components/checklist/ChecklistItemParent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ export default {
depth: { type: Number, required: true },
allChecklistNodes: { type: Array, required: true },
},
data() {
return {
checklistNodes: [],
}
},
computed: {
activities() {
const camp = this.checklistItem.checklist().camp()
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@
"delete": "Do you really want to remove this item?",
"title": "Edit checklist entry"
},
"checklistDetail": {
"deleteWarning": "Do you really want to remove this checklist? All content of the checklist will be deleted.",
"deleteError": "Checklist couldn't be deleted. Ensure checklist is not used within activities before trying to delete it."
},
"sortableChecklist": {
"add": "Add to \"{parent}\""
}
Expand Down

0 comments on commit e3ee046

Please sign in to comment.