@webitel/ui-sdk 1.0.22 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -22,9 +22,7 @@ export default class QueryFiltersStoreModule extends BaseStoreModule {
22
22
  let newValue = value;
23
23
  if (newValue) {
24
24
  if (multiple && !Array.isArray(newValue)) newValue = [newValue];
25
- } else {
26
- newValue = defaultValue;
27
- }
25
+ } else if (newValue === null || newValue === undefined) newValue = defaultValue;
28
26
  context.commit('SET_FILTER', { filter, value: newValue });
29
27
  },
30
28
  RESET_FILTERS: (context) => {
@@ -67,6 +67,12 @@ describe('QueryFiltersStoreModule actions', () => {
67
67
  expect(context.commit)
68
68
  .toHaveBeenCalledWith('SET_FILTER', { filter: filter.filter, value: [] });
69
69
  });
70
+ it('SET_FILTER: sets "false" value filter', () => {
71
+ const filter = { filter: valueFilter, value: false };
72
+ module.actions.SET_FILTER(context, filter);
73
+ expect(context.commit)
74
+ .toHaveBeenCalledWith('SET_FILTER', { filter: filter.filter, value: false });
75
+ });
70
76
  it('calls RESET_FILTERS mutation on RESET_FILTERS action call', () => {
71
77
  module.actions.RESET_FILTERS(context);
72
78
  expect(context.commit).toHaveBeenCalledWith('RESET_FILTERS');