@eox/itemfilter 1.3.1 → 1.4.0
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/README.md +4 -0
- package/dist/eox-itemfilter.js +984 -1111
- package/dist/eox-itemfilter.umd.cjs +106 -108
- package/package.json +8 -13
- package/src/components/chips.js +131 -0
- package/src/components/expand-container.js +94 -0
- package/src/components/filters/range.js +114 -0
- package/src/components/filters/selector.js +245 -0
- package/src/components/filters/spatial.js +192 -0
- package/src/components/filters/text.js +114 -0
- package/src/components/itemfilter-container.js +289 -0
- package/src/components/results.js +156 -0
- package/src/enums/config.js +104 -0
- package/src/enums/index.js +1 -0
- package/src/helpers/chip-items.js +19 -0
- package/src/helpers/filter-client.js +179 -0
- package/src/helpers/filter-external.js +18 -0
- package/src/helpers/get-value.js +12 -0
- package/src/helpers/highlighting.js +79 -0
- package/src/helpers/index.js +11 -0
- package/src/helpers/is-filters-dirty.js +13 -0
- package/src/helpers/map-layers.js +42 -0
- package/src/helpers/reset-filter.js +60 -0
- package/src/helpers/spatial.js +35 -0
- package/src/helpers/tab-index.js +13 -0
- package/src/helpers/toggle-accordion.js +39 -0
- package/src/main.js +466 -0
- package/src/methods/chips/handler.js +129 -0
- package/src/methods/chips/index.js +5 -0
- package/src/methods/container/handler.js +70 -0
- package/src/methods/container/index.js +10 -0
- package/src/methods/container/init-popver.js +34 -0
- package/src/methods/container/reset-filter.js +14 -0
- package/src/methods/container/reset-search.js +16 -0
- package/src/methods/container/search-filter.js +27 -0
- package/src/methods/filters/index.js +20 -0
- package/src/methods/filters/range.js +78 -0
- package/src/methods/filters/selector.js +209 -0
- package/src/methods/filters/spatial.js +114 -0
- package/src/methods/filters/text.js +32 -0
- package/src/methods/itemfilter/create-filter.js +83 -0
- package/src/methods/itemfilter/create-reset.js +39 -0
- package/src/methods/itemfilter/filter-apply.js +140 -0
- package/src/methods/itemfilter/index.js +6 -0
- package/src/methods/itemfilter/reset-filter.js +13 -0
- package/src/methods/itemfilter/search.js +23 -0
- package/src/methods/itemfilter/sort-results.js +14 -0
- package/src/methods/results/aggregate-results.js +43 -0
- package/src/methods/results/create.js +111 -0
- package/src/methods/results/index.js +2 -0
- package/src/style.eox.js +457 -0
- package/src/style.js +26 -0
- package/test/_mockMap.js +0 -20
- package/test/cases/filters/filter-keys.js +0 -22
- package/test/cases/filters/index.js +0 -3
- package/test/cases/general/accordion.js +0 -60
- package/test/cases/general/disable-highlight.js +0 -21
- package/test/cases/general/external-filter.js +0 -35
- package/test/cases/general/highlight-result.js +0 -16
- package/test/cases/general/index.js +0 -13
- package/test/cases/general/multiple-filters.js +0 -21
- package/test/cases/general/nested-property.js +0 -25
- package/test/cases/general/search-bar.js +0 -12
- package/test/cases/general/search-result.js +0 -14
- package/test/cases/general/spatial-filter.js +0 -22
- package/test/cases/general/subtitle.js +0 -15
- package/test/cases/general/validation.js +0 -22
- package/test/cases/state/custom-order.js +0 -24
- package/test/cases/state/index.js +0 -6
- package/test/cases/state/render-checkbox.js +0 -17
- package/test/cases/state/result-pre-checked.js +0 -20
- package/test/cases/state/results-with-pre-set-filters.js +0 -30
- package/test/filters.cy.js +0 -54
- package/test/general.cy.js +0 -110
- package/test/state.cy.js +0 -74
- package/test/testItems.json +0 -532
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests the behavior of the eox-itemfilter when it has nested property as a key
|
|
3
|
-
*/
|
|
4
|
-
const nestedPropertyTest = () => {
|
|
5
|
-
cy.get("eox-itemfilter").then(($el) => {
|
|
6
|
-
$el[0].filterProperties = [
|
|
7
|
-
...$el[0].filterProperties,
|
|
8
|
-
{ key: "status.code", title: "Status", expanded: true },
|
|
9
|
-
];
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
cy.get("eox-itemfilter")
|
|
13
|
-
.shadow()
|
|
14
|
-
.within(() => {
|
|
15
|
-
cy.get("[id='filter-status.code']")
|
|
16
|
-
.shadow()
|
|
17
|
-
.within(() => {
|
|
18
|
-
cy.get('[type="checkbox"]').first().check();
|
|
19
|
-
cy.get(".title").first().contains("active");
|
|
20
|
-
cy.get(".title").last().contains("inactive");
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default nestedPropertyTest;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests the existence of the search bar in the eox-itemfilter component.
|
|
3
|
-
*/
|
|
4
|
-
const searchBarTest = () => {
|
|
5
|
-
cy.get("eox-itemfilter")
|
|
6
|
-
.shadow()
|
|
7
|
-
.within(() => {
|
|
8
|
-
cy.get("[data-cy='search']").should("exist");
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default searchBarTest;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests the search functionality in the eox-itemfilter component.
|
|
3
|
-
* It types a search query and verifies that search results are displayed.
|
|
4
|
-
*/
|
|
5
|
-
const searchResultTest = () => {
|
|
6
|
-
cy.get("eox-itemfilter")
|
|
7
|
-
.shadow()
|
|
8
|
-
.within(() => {
|
|
9
|
-
cy.get("[data-cy='search']").type("white");
|
|
10
|
-
cy.get("ul#results").children();
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default searchResultTest;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests the behavior of the checkboxes within the eox-itemfilter-select component,
|
|
3
|
-
* ensuring that checkboxes can be toggled correctly.
|
|
4
|
-
*/
|
|
5
|
-
const spatialFilterTest = () => {
|
|
6
|
-
cy.get("eox-itemfilter")
|
|
7
|
-
.shadow()
|
|
8
|
-
.within(() => {
|
|
9
|
-
cy.get("eox-itemfilter-select")
|
|
10
|
-
.shadow()
|
|
11
|
-
.within(() => {
|
|
12
|
-
cy.get('[type="checkbox"]').first().check();
|
|
13
|
-
cy.get('[type="checkbox"]').eq(1).check();
|
|
14
|
-
cy.get('[type="checkbox"]').first().check();
|
|
15
|
-
cy.get('[type="checkbox"]').first().should("be.checked");
|
|
16
|
-
cy.get('[type="checkbox"]').eq(1).check();
|
|
17
|
-
cy.get('[type="checkbox"]').eq(1).should("be.checked");
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default spatialFilterTest;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests the subtitle functionality. If the confif option `subTitleProperty` is set,
|
|
3
|
-
* then an additional subtitle is rendered.
|
|
4
|
-
*/
|
|
5
|
-
const subtitleTest = () => {
|
|
6
|
-
cy.get("eox-itemfilter")
|
|
7
|
-
.shadow()
|
|
8
|
-
.within(() => {
|
|
9
|
-
cy.get("eox-itemfilter-results").within(() => {
|
|
10
|
-
cy.get(".title").siblings(".subtitle").should("exist");
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default subtitleTest;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests the validation option of the text input.
|
|
3
|
-
*/
|
|
4
|
-
const validationTest = () => {
|
|
5
|
-
cy.get("eox-itemfilter")
|
|
6
|
-
.shadow()
|
|
7
|
-
.within(() => {
|
|
8
|
-
cy.get("[data-cy='text-filter']").then(($elList) => {
|
|
9
|
-
const el = $elList[0];
|
|
10
|
-
cy.get(".error-validation").should("not.have.text");
|
|
11
|
-
cy.get("[data-cy='search']").type("abcdefghijk");
|
|
12
|
-
cy.get(".error-validation").should(
|
|
13
|
-
"have.text",
|
|
14
|
-
el.filterObject.validation.message
|
|
15
|
-
);
|
|
16
|
-
cy.get("[data-cy='search']").clear();
|
|
17
|
-
cy.get(".error-validation").should("not.have.text");
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default validationTest;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests the custom order of items within the eox-itemfilter-select component.
|
|
3
|
-
* It verifies that the items are ordered according to the provided custom order.
|
|
4
|
-
*
|
|
5
|
-
* @param {Object} customOrder - An object representing the custom order, where keys are item states and values are their expected positions.
|
|
6
|
-
*/
|
|
7
|
-
const customOrderTest = (customOrder) => {
|
|
8
|
-
cy.get("eox-itemfilter")
|
|
9
|
-
.shadow()
|
|
10
|
-
.within(() => {
|
|
11
|
-
cy.get("eox-itemfilter-select")
|
|
12
|
-
.shadow()
|
|
13
|
-
.within(() => {
|
|
14
|
-
Object.keys(customOrder).forEach((state) => {
|
|
15
|
-
cy.get("ul [data-identifier]")
|
|
16
|
-
.eq(customOrder[state])
|
|
17
|
-
.invoke("attr", "data-identifier")
|
|
18
|
-
.should("eq", state);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default customOrderTest;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// Exported test methods
|
|
2
|
-
|
|
3
|
-
export { default as renderCheckboxTest } from "./render-checkbox";
|
|
4
|
-
export { default as resultsWithPreSetFiltersTest } from "./results-with-pre-set-filters";
|
|
5
|
-
export { default as resultPreCheckedTest } from "./result-pre-checked";
|
|
6
|
-
export { default as customOrderTest } from "./custom-order";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests the rendering of checkboxes within the eox-itemfilter-select component.
|
|
3
|
-
* It verifies that the expected number of checkboxes are checked.
|
|
4
|
-
*/
|
|
5
|
-
const renderCheckboxTest = () => {
|
|
6
|
-
cy.get("eox-itemfilter")
|
|
7
|
-
.shadow()
|
|
8
|
-
.within(() => {
|
|
9
|
-
cy.get("eox-itemfilter-select")
|
|
10
|
-
.shadow()
|
|
11
|
-
.within(() => {
|
|
12
|
-
cy.get('[type="checkbox"]:checked').should("have.length", 2);
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default renderCheckboxTest;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests that the specified result is pre-checked in the eox-itemfilter-results component.
|
|
3
|
-
* It verifies that the result at the specified index is selected and that only one result is selected.
|
|
4
|
-
*
|
|
5
|
-
* @param {number} selectedResultIndex - The index of the result that should be pre-checked.
|
|
6
|
-
*/
|
|
7
|
-
const resultPreCheckedTest = (selectedResultIndex) => {
|
|
8
|
-
cy.get("eox-itemfilter")
|
|
9
|
-
.shadow()
|
|
10
|
-
.within(() => {
|
|
11
|
-
cy.get("eox-itemfilter-results").within(() => {
|
|
12
|
-
cy.get(".details-results li")
|
|
13
|
-
.eq(selectedResultIndex)
|
|
14
|
-
.should("have.class", "highlighted");
|
|
15
|
-
cy.get(".details-results li.highlighted").should("have.length", 1);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default resultPreCheckedTest;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests that the results in the eox-itemfilter-results component are correctly displayed
|
|
3
|
-
* based on the pre-set filters provided in the state.
|
|
4
|
-
*
|
|
5
|
-
* @param {Object} state - An object representing the pre-set filters, where keys are filter names.
|
|
6
|
-
*/
|
|
7
|
-
const resultsWithPreSetFiltersTest = (state) => {
|
|
8
|
-
cy.get("eox-itemfilter")
|
|
9
|
-
.shadow()
|
|
10
|
-
.within(() => {
|
|
11
|
-
cy.get("eox-itemfilter-results").within(() => {
|
|
12
|
-
Object.keys(state).forEach((key) => {
|
|
13
|
-
cy.get(".details-results > summary > .title").should(
|
|
14
|
-
"contain.text",
|
|
15
|
-
key
|
|
16
|
-
);
|
|
17
|
-
cy.get(".details-results > summary > .title").should(
|
|
18
|
-
"contain.text",
|
|
19
|
-
key
|
|
20
|
-
);
|
|
21
|
-
});
|
|
22
|
-
cy.get(".details-results > summary > .title").should(
|
|
23
|
-
"have.length",
|
|
24
|
-
Object.keys(state).length
|
|
25
|
-
);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default resultsWithPreSetFiltersTest;
|
package/test/filters.cy.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import "../src/main";
|
|
2
|
-
import testItems from "./testItems.json";
|
|
3
|
-
import { filterkeysTest } from "./cases/filters/";
|
|
4
|
-
|
|
5
|
-
describe("Item Filter Config", () => {
|
|
6
|
-
const state = {
|
|
7
|
-
agriculture: true,
|
|
8
|
-
health: true,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const customOrder = {
|
|
12
|
-
health: 0,
|
|
13
|
-
water: 1,
|
|
14
|
-
air: 2,
|
|
15
|
-
economy: 3,
|
|
16
|
-
agriculture: 4,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const selectedResultIndex = 1;
|
|
20
|
-
|
|
21
|
-
const filterKeys = ["foo", "bar", 0, true];
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Runs before each test case to mount the eox-itemfilter component and configure it.
|
|
25
|
-
*/
|
|
26
|
-
beforeEach(() => {
|
|
27
|
-
cy.mount(`<eox-itemfilter></eox-itemfilter>`)
|
|
28
|
-
.as("eox-itemfilter")
|
|
29
|
-
.then(($el) => {
|
|
30
|
-
const eoxItemFilter = $el[0];
|
|
31
|
-
Object.assign(eoxItemFilter, {
|
|
32
|
-
titleProperty: "title",
|
|
33
|
-
filterProperties: [
|
|
34
|
-
{
|
|
35
|
-
key: "themes",
|
|
36
|
-
type: "multiselect",
|
|
37
|
-
expanded: true,
|
|
38
|
-
sort: (a, b) => customOrder[a] - customOrder[b],
|
|
39
|
-
state,
|
|
40
|
-
filterKeys,
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
aggregateResults: "themes",
|
|
44
|
-
items: testItems,
|
|
45
|
-
selectedResult: testItems[selectedResultIndex],
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Test case for filterKeys
|
|
52
|
-
*/
|
|
53
|
-
it("should support setting filterKeys", () => filterkeysTest(filterKeys));
|
|
54
|
-
});
|
package/test/general.cy.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import "../src/main";
|
|
2
|
-
import "./_mockMap";
|
|
3
|
-
import testItems from "./testItems.json";
|
|
4
|
-
import {
|
|
5
|
-
searchBarTest,
|
|
6
|
-
searchResultTest,
|
|
7
|
-
highlightResultTest,
|
|
8
|
-
multipleResultTest,
|
|
9
|
-
disableHighlightTest,
|
|
10
|
-
accordionTest,
|
|
11
|
-
spatialFilterTest,
|
|
12
|
-
externalFilterTest,
|
|
13
|
-
nestedPropertyTest,
|
|
14
|
-
subtitleTest,
|
|
15
|
-
validationTest,
|
|
16
|
-
} from "./cases/general/";
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Test suite for the EOX Item Filter component configuration.
|
|
20
|
-
*/
|
|
21
|
-
describe("Item Filter Config", () => {
|
|
22
|
-
/**
|
|
23
|
-
* Runs before each test case to mount the eox-itemfilter component and configure it.
|
|
24
|
-
*/
|
|
25
|
-
beforeEach(() => {
|
|
26
|
-
cy.mount(`<eox-itemfilter></eox-itemfilter>`)
|
|
27
|
-
.as("eox-itemfilter")
|
|
28
|
-
.then(($el) => {
|
|
29
|
-
const eoxItemFilter = $el[0];
|
|
30
|
-
// Set the configuration and items for the eox-itemfilter component
|
|
31
|
-
Object.assign(eoxItemFilter, {
|
|
32
|
-
titleProperty: "title",
|
|
33
|
-
subTitleProperty: "description",
|
|
34
|
-
filterProperties: [
|
|
35
|
-
{
|
|
36
|
-
keys: ["title", "themes"],
|
|
37
|
-
title: "Search",
|
|
38
|
-
type: "text",
|
|
39
|
-
expanded: true,
|
|
40
|
-
validation: {
|
|
41
|
-
pattern: ".{0,10}",
|
|
42
|
-
message: "Maximum 10 characters",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{ key: "themes", expanded: true },
|
|
46
|
-
],
|
|
47
|
-
aggregateResults: "themes",
|
|
48
|
-
enableHighlighting: true,
|
|
49
|
-
items: testItems,
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Test case to verify the existence of the search bar.
|
|
56
|
-
*/
|
|
57
|
-
it("should have a search bar", () => searchBarTest());
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Test case to verify filtering results based on the search string.
|
|
61
|
-
*/
|
|
62
|
-
it("should filter results based on search string", () => searchResultTest());
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Test case to verify highlighting of results.
|
|
66
|
-
*/
|
|
67
|
-
it("should highlight results", () => highlightResultTest());
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Test case to verify disabling of highlight.
|
|
71
|
-
*/
|
|
72
|
-
it("should disable highlight", () => disableHighlightTest());
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Test case to verify allowing multiple filters.
|
|
76
|
-
*/
|
|
77
|
-
it("should allow multiple filters", () => multipleResultTest());
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Test case to verify that only one accordion of each type can be open at a time if configured.
|
|
81
|
-
*/
|
|
82
|
-
it("should allow only one accordion of each type to be open at a time if configured", () =>
|
|
83
|
-
accordionTest());
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Test case to verify the display of the map when the spatial filter is enabled.
|
|
87
|
-
*/
|
|
88
|
-
it("should show the map when spatial filter is enabled", () =>
|
|
89
|
-
spatialFilterTest());
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Test case to check whether itemfilter is using external filter correctly or not.
|
|
93
|
-
*/
|
|
94
|
-
it("should run external filter", () => externalFilterTest());
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Test case to check whether nested properties work or not
|
|
98
|
-
*/
|
|
99
|
-
it("should run with nested property", () => nestedPropertyTest());
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Test case to check if subtitles are rendered correctly
|
|
103
|
-
*/
|
|
104
|
-
it("should render subtitles", () => subtitleTest());
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Test case to check if input validation is working
|
|
108
|
-
*/
|
|
109
|
-
it("should have working validation", () => validationTest());
|
|
110
|
-
});
|
package/test/state.cy.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import "../src/main";
|
|
2
|
-
import testItems from "./testItems.json";
|
|
3
|
-
import {
|
|
4
|
-
customOrderTest,
|
|
5
|
-
renderCheckboxTest,
|
|
6
|
-
resultPreCheckedTest,
|
|
7
|
-
resultsWithPreSetFiltersTest,
|
|
8
|
-
} from "./cases/state/";
|
|
9
|
-
|
|
10
|
-
describe("Item Filter Config", () => {
|
|
11
|
-
const state = {
|
|
12
|
-
agriculture: true,
|
|
13
|
-
health: true,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const customOrder = {
|
|
17
|
-
health: 0,
|
|
18
|
-
water: 1,
|
|
19
|
-
air: 2,
|
|
20
|
-
economy: 3,
|
|
21
|
-
agriculture: 4,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const selectedResultIndex = 1;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Runs before each test case to mount the eox-itemfilter component and configure it.
|
|
28
|
-
*/
|
|
29
|
-
beforeEach(() => {
|
|
30
|
-
cy.mount(`<eox-itemfilter></eox-itemfilter>`)
|
|
31
|
-
.as("eox-itemfilter")
|
|
32
|
-
.then(($el) => {
|
|
33
|
-
const eoxItemFilter = $el[0];
|
|
34
|
-
Object.assign(eoxItemFilter, {
|
|
35
|
-
titleProperty: "title",
|
|
36
|
-
idProperty: "title",
|
|
37
|
-
filterProperties: [
|
|
38
|
-
{
|
|
39
|
-
key: "themes",
|
|
40
|
-
type: "multiselect",
|
|
41
|
-
expanded: true,
|
|
42
|
-
sort: (a, b) => customOrder[a] - customOrder[b],
|
|
43
|
-
state,
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
aggregateResults: "themes",
|
|
47
|
-
items: testItems,
|
|
48
|
-
selectedResult: testItems[selectedResultIndex],
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Test case to render the checkboxes as checked
|
|
55
|
-
*/
|
|
56
|
-
it("should render the checkboxes as checked", () => renderCheckboxTest());
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Test case to only show the results of the pre-set filters
|
|
60
|
-
*/
|
|
61
|
-
it("should only show the results of the pre-set filters", () =>
|
|
62
|
-
resultsWithPreSetFiltersTest(state));
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Test case to render the pre-set result as checked
|
|
66
|
-
*/
|
|
67
|
-
it("should render the pre-set result as checked", () =>
|
|
68
|
-
resultPreCheckedTest(selectedResultIndex));
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Test case to have a custom order
|
|
72
|
-
*/
|
|
73
|
-
it("should have a custom order", () => customOrderTest(customOrder));
|
|
74
|
-
});
|