mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
updated CategoriesFilter tests
This commit is contained in:
parent
f927c13b86
commit
084b14608d
@ -63,12 +63,13 @@ describe('CategoriesFilter.vue', () => {
|
||||
expect(allCategoriesButton.attributes().class).toContain('--filled')
|
||||
})
|
||||
|
||||
it('sets category button attribute `filled` when corresponding category is filtered', async () => {
|
||||
getters['posts/filteredCategoryIds'] = jest.fn(() => ['cat9'])
|
||||
wrapper = await Wrapper()
|
||||
democracyAndPoliticsButton = wrapper.find('.categories-filter .item-save-topics .base-button')
|
||||
expect(democracyAndPoliticsButton.attributes().class).toContain('--filled')
|
||||
})
|
||||
// TODO move to FilterMenuComponent.spec.js?
|
||||
// it('sets category button attribute `filled` when corresponding category is filtered', async () => {
|
||||
// getters['posts/filteredCategoryIds'] = jest.fn(() => ['cat9'])
|
||||
// wrapper = await Wrapper()
|
||||
// democracyAndPoliticsButton = wrapper.find('.categories-filter .item-save-topics .base-button')
|
||||
// expect(democracyAndPoliticsButton.attributes().class).toContain('--filled')
|
||||
// })
|
||||
|
||||
describe('click on an "catetories-buttons" button', () => {
|
||||
it('calls TOGGLE_CATEGORY when clicked', () => {
|
||||
@ -88,13 +89,14 @@ describe('CategoriesFilter.vue', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('save categories', () => {
|
||||
it('calls the API', async () => {
|
||||
wrapper = await Wrapper()
|
||||
const saveButton = wrapper.find('.categories-filter .item-save-topics .base-button')
|
||||
saveButton.trigger('click')
|
||||
expect(apolloMutationMock).toBeCalled()
|
||||
})
|
||||
})
|
||||
// TODO move to FilterMenuComponent.spec.js?
|
||||
// describe('save categories', () => {
|
||||
// it('calls the API', async () => {
|
||||
// wrapper = await Wrapper()
|
||||
// const saveButton = wrapper.find('.categories-filter .item-save-topics .base-button')
|
||||
// saveButton.trigger('click')
|
||||
// expect(apolloMutationMock).toBeCalled()
|
||||
// })
|
||||
// })
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user