From 64b9c0eb56b4e766fda322d465dda96589659dd6 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Fri, 11 Mar 2022 05:45:29 +0300 Subject: [PATCH] Extract filter store from the search store and convert it to Pinia (#1039) * Extract filter store from the search store * Fix CI failures * Apply changes from the code review * Remove tape * Add e2e test for total filter count for different search types --- src/components/VFilters/VFilterChecklist.vue | 30 +- src/components/VFilters/VSearchGridFilter.vue | 9 +- src/components/VHeader/VFilterButton.vue | 9 +- src/components/VLicenseElements.vue | 3 + src/constants/mutation-types.js | 4 - src/locales/po-files/openverse.pot | 4 +- src/pages/search.vue | 7 +- src/store/provider.js | 17 +- src/store/search.js | 273 ++---------- src/store/types.ts | 4 +- src/stores/filter.js | 280 ++++++++++++ test/e2e/filters.spec.js | 106 ++++- test/e2e/image-detail.spec.js | 4 +- test/e2e/search-query-server.spec.js | 10 +- test/e2e/search-types.spec.js | 2 + test/e2e/utils.js | 24 +- test/tapes/response-50.json5 | 410 ++++++++++++++++++ .../VHeader/v-filter-button.spec.js | 69 +-- ...ist.spec.js => v-filter-checklist.spec.js} | 7 + ...r.spec.js => v-search-grid-filter.spec.js} | 58 +-- test/unit/specs/pages/browse-page.spec.js | 4 - test/unit/specs/store/filter-store.spec.js | 269 ++++++++++++ test/unit/specs/store/provider.spec.js | 4 + test/unit/specs/store/search-store.spec.js | 202 ++------- 24 files changed, 1242 insertions(+), 567 deletions(-) create mode 100644 src/stores/filter.js create mode 100644 test/tapes/response-50.json5 rename test/unit/specs/components/{filter-checklist.spec.js => v-filter-checklist.spec.js} (87%) rename test/unit/specs/components/{search-grid-filter.spec.js => v-search-grid-filter.spec.js} (59%) create mode 100644 test/unit/specs/store/filter-store.spec.js diff --git a/src/components/VFilters/VFilterChecklist.vue b/src/components/VFilters/VFilterChecklist.vue index cd7311b592..09cf4f62f0 100644 --- a/src/components/VFilters/VFilterChecklist.vue +++ b/src/components/VFilters/VFilterChecklist.vue @@ -56,6 +56,8 @@