Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
fixed test for isfilterapplied in filterdisplay
Browse files Browse the repository at this point in the history
  • Loading branch information
brenoferreira committed Apr 30, 2020
1 parent bcac95a commit 98f2d07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/components/Filters/FilterDisplay.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="filter-display padding-horizontal-normal" aria-live="polite">
<span v-if="anyFilterApplied()" class="caption has-text-weight-semibold">Filter By</span>
<span v-if="anyFilterApplied" class="caption has-text-weight-semibold">Filter By</span>
<span v-for="filter in getFilters('licenses')" :key="filter.code">
<filter-block :code="filter.code"
:label="filter.name"
Expand Down Expand Up @@ -84,6 +84,9 @@ export default {
mature() {
return this.$store.state.filters.mature;
},
anyFilterApplied() {
return this.$store.state.isFilterApplied;
},
},
methods: {
getFilters(filterType) {
Expand All @@ -96,9 +99,6 @@ export default {
});
return filterTags;
},
anyFilterApplied() {
return this.$store.state.isFilterApplied;
},
onUpdateFilter({ code, filterType }) {
this.$store.dispatch(TOGGLE_FILTER, {
code,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/specs/components/filter-display.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('FilterDisplay', () => {
});

it('should render filter by caption label', () => {
filters.licenses[0].checked = true;
options.mocks.$store.state.isFilterApplied = true;
const wrapper = render(FilterDisplay, options);
expect(wrapper.find('.caption').element.textContent).toBe('Filter By');
});
Expand Down

0 comments on commit 98f2d07

Please sign in to comment.