Commit 1899450d authored by Angelina Filippova's avatar Angelina Filippova

Rename action that sets reports filter

parent 13ace35a
...@@ -52,7 +52,7 @@ const reports = { ...@@ -52,7 +52,7 @@ const reports = {
commit('SET_PAGE', page) commit('SET_PAGE', page)
commit('SET_LOADING', false) commit('SET_LOADING', false)
}, },
SetFilter({ commit }, filter) { SetReportsFilter({ commit }, filter) {
commit('SET_REPORTS_FILTER', filter) commit('SET_REPORTS_FILTER', filter)
}, },
CreateReportNote({ commit, getters, state, rootState }, { content, reportID }) { CreateReportNote({ commit, getters, state, rootState }, { content, reportID }) {
......
...@@ -38,11 +38,11 @@ export default { ...@@ -38,11 +38,11 @@ export default {
} }
}, },
created() { created() {
this.$store.dispatch('SetFilter', this.$data.filter) this.$store.dispatch('SetReportsFilter', this.$data.filter)
}, },
methods: { methods: {
toggleFilters() { toggleFilters() {
this.$store.dispatch('SetFilter', this.$data.filter) this.$store.dispatch('SetReportsFilter', this.$data.filter)
this.$store.dispatch('ClearFetchedReports') this.$store.dispatch('ClearFetchedReports')
this.$store.dispatch('FetchReports', 1) this.$store.dispatch('FetchReports', 1)
} }
......
...@@ -26,7 +26,7 @@ describe('Reports filter', () => { ...@@ -26,7 +26,7 @@ describe('Reports filter', () => {
it('shows open reports when "Open" filter is applied', async (done) => { it('shows open reports when "Open" filter is applied', async (done) => {
expect(store.state.reports.fetchedReports.length).toEqual(7) expect(store.state.reports.fetchedReports.length).toEqual(7)
store.dispatch('SetFilter', 'open') store.dispatch('SetReportsFilter', 'open')
store.dispatch('ClearFetchedReports') store.dispatch('ClearFetchedReports')
store.dispatch('FetchReports', 1) store.dispatch('FetchReports', 1)
await flushPromises() await flushPromises()
...@@ -38,7 +38,7 @@ describe('Reports filter', () => { ...@@ -38,7 +38,7 @@ describe('Reports filter', () => {
it('shows resolved reports when "Resolved" filter is applied', async (done) => { it('shows resolved reports when "Resolved" filter is applied', async (done) => {
expect(store.state.reports.fetchedReports.length).toEqual(7) expect(store.state.reports.fetchedReports.length).toEqual(7)
store.dispatch('SetFilter', 'resolved') store.dispatch('SetReportsFilter', 'resolved')
store.dispatch('ClearFetchedReports') store.dispatch('ClearFetchedReports')
store.dispatch('FetchReports') store.dispatch('FetchReports')
await flushPromises() await flushPromises()
...@@ -50,7 +50,7 @@ describe('Reports filter', () => { ...@@ -50,7 +50,7 @@ describe('Reports filter', () => {
it('shows closed reports when "Closed" filter is applied', async (done) => { it('shows closed reports when "Closed" filter is applied', async (done) => {
expect(store.state.reports.fetchedReports.length).toEqual(7) expect(store.state.reports.fetchedReports.length).toEqual(7)
store.dispatch('SetFilter', 'closed') store.dispatch('SetReportsFilter', 'closed')
store.dispatch('ClearFetchedReports') store.dispatch('ClearFetchedReports')
store.dispatch('FetchReports') store.dispatch('FetchReports')
await flushPromises() await flushPromises()
...@@ -62,13 +62,13 @@ describe('Reports filter', () => { ...@@ -62,13 +62,13 @@ describe('Reports filter', () => {
it('shows all users after removing filters', async (done) => { it('shows all users after removing filters', async (done) => {
expect(store.state.reports.fetchedReports.length).toEqual(7) expect(store.state.reports.fetchedReports.length).toEqual(7)
store.dispatch('SetFilter', 'open') store.dispatch('SetReportsFilter', 'open')
store.dispatch('ClearFetchedReports') store.dispatch('ClearFetchedReports')
store.dispatch('FetchReports') store.dispatch('FetchReports')
await flushPromises() await flushPromises()
expect(store.state.reports.fetchedReports.length).toEqual(2) expect(store.state.reports.fetchedReports.length).toEqual(2)
store.dispatch('SetFilter', '') store.dispatch('SetReportsFilter', '')
store.dispatch('ClearFetchedReports') store.dispatch('ClearFetchedReports')
store.dispatch('FetchReports') store.dispatch('FetchReports')
await flushPromises() await flushPromises()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment