@eox/itemfilter 0.12.0 → 0.13.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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@eox/itemfilter",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
6
  "@eox/eslint-config": "^1.0.0",
7
7
  "@types/lodash.debounce": "^4.0.7",
8
- "@typescript-eslint/eslint-plugin": "^6.8.0",
9
- "@typescript-eslint/parser": "^6.8.0",
8
+ "@typescript-eslint/eslint-plugin": "^7.0.1",
9
+ "@typescript-eslint/parser": "^7.0.1",
10
10
  "eslint-plugin-typescript": "^0.14.0",
11
11
  "typescript": "^5.2.2",
12
12
  "vite": "^5.0.2"
@@ -13,21 +13,23 @@ describe("Item Filter Config", () => {
13
13
  .as("eox-itemfilter")
14
14
  .then(($el) => {
15
15
  const eoxItemFilter = <EOxItemFilter>$el[0];
16
- eoxItemFilter.config = {
17
- titleProperty: "title",
18
- filterProperties: [
19
- {
20
- keys: ["title", "themes"],
21
- title: "Search",
22
- type: "text",
23
- expanded: true,
24
- },
25
- { key: "themes", expanded: true },
26
- ],
27
- aggregateResults: "themes",
28
- enableHighlighting: true,
29
- };
30
- eoxItemFilter.apply(testItems);
16
+ Object.assign(eoxItemFilter, {
17
+ config: {
18
+ titleProperty: "title",
19
+ filterProperties: [
20
+ {
21
+ keys: ["title", "themes"],
22
+ title: "Search",
23
+ type: "text",
24
+ expanded: true,
25
+ },
26
+ { key: "themes", expanded: true },
27
+ ],
28
+ aggregateResults: "themes",
29
+ enableHighlighting: true,
30
+ },
31
+ items: testItems,
32
+ });
31
33
  });
32
34
  });
33
35
 
@@ -87,16 +89,14 @@ describe("Item Filter Config", () => {
87
89
  cy.get("eox-itemfilter")
88
90
  .shadow()
89
91
  .within(() => {
90
- cy.get("eox-selectionlist")
91
- .shadow()
92
- .within(() => {
93
- cy.get('[type="checkbox"]').first().check();
94
- cy.get('[type="checkbox"]').eq(1).check();
95
- cy.get('[type="checkbox"]').first().check();
96
- cy.get('[type="checkbox"]').first().should("be.checked");
97
- cy.get('[type="checkbox"]').eq(1).check();
98
- cy.get('[type="checkbox"]').eq(1).should("be.checked");
99
- });
92
+ cy.get("eox-selectionlist").within(() => {
93
+ cy.get('[type="checkbox"]').first().check();
94
+ cy.get('[type="checkbox"]').eq(1).check();
95
+ cy.get('[type="checkbox"]').first().check();
96
+ cy.get('[type="checkbox"]').first().should("be.checked");
97
+ cy.get('[type="checkbox"]').eq(1).check();
98
+ cy.get('[type="checkbox"]').eq(1).should("be.checked");
99
+ });
100
100
  });
101
101
  });
102
102
 
@@ -197,17 +197,19 @@ describe("Item Filter Config", () => {
197
197
  it("should show the map when spatial filter is enabled", () => {
198
198
  cy.get("eox-itemfilter").and(($el) => {
199
199
  const eoxItemFilter = <EOxItemFilter>$el[0];
200
- eoxItemFilter.config = {
201
- titleProperty: "title",
202
- filterProperties: [
203
- {
204
- key: "geometry",
205
- type: "spatial",
206
- expanded: true,
207
- },
208
- ],
209
- };
210
- eoxItemFilter.apply(testItems);
200
+ Object.assign(eoxItemFilter, {
201
+ config: {
202
+ titleProperty: "title",
203
+ filterProperties: [
204
+ {
205
+ key: "geometry",
206
+ type: "spatial",
207
+ expanded: true,
208
+ },
209
+ ],
210
+ },
211
+ items: testItems,
212
+ });
211
213
  });
212
214
  cy.get("eox-itemfilter")
213
215
  .shadow()
package/test/state.cy.ts CHANGED
@@ -19,22 +19,25 @@ describe("Item Filter Config", () => {
19
19
  .as("eox-itemfilter")
20
20
  .then(($el) => {
21
21
  const eoxItemFilter = <EOxItemFilter>$el[0];
22
- eoxItemFilter.config = {
23
- titleProperty: "title",
24
- filterProperties: [
25
- {
26
- key: "themes",
27
- type: "multiselect",
28
- expanded: true,
29
- sort: (a, b) => customOrder[a] - customOrder[b],
30
- // @ts-ignore
31
- state,
32
- },
33
- ],
34
- aggregateResults: "themes",
35
- };
36
- eoxItemFilter.apply(testItems);
37
- eoxItemFilter.selectedResult = testItems[selectedResultIndex];
22
+ Object.assign(eoxItemFilter, {
23
+ config: {
24
+ titleProperty: "title",
25
+ filterProperties: [
26
+ {
27
+ key: "themes",
28
+ type: "multiselect",
29
+ expanded: true,
30
+ // @ts-ignore
31
+ sort: (a, b) => customOrder[a] - customOrder[b],
32
+ // @ts-ignore
33
+ state,
34
+ },
35
+ ],
36
+ aggregateResults: "themes",
37
+ },
38
+ items: testItems,
39
+ selectedResult: testItems[selectedResultIndex],
40
+ });
38
41
  });
39
42
  });
40
43
 
@@ -42,11 +45,9 @@ describe("Item Filter Config", () => {
42
45
  cy.get("eox-itemfilter")
43
46
  .shadow()
44
47
  .within(() => {
45
- cy.get("eox-selectionlist")
46
- .shadow()
47
- .within(() => {
48
- cy.get('[type="checkbox"]:checked').should("have.length", 2);
49
- });
48
+ cy.get("eox-selectionlist").within(() => {
49
+ cy.get('[type="checkbox"]:checked').should("have.length", 2);
50
+ });
50
51
  });
51
52
  });
52
53
 
@@ -86,16 +87,14 @@ describe("Item Filter Config", () => {
86
87
  cy.get("eox-itemfilter")
87
88
  .shadow()
88
89
  .within(() => {
89
- cy.get("eox-itemfilter-multiselect > eox-selectionlist")
90
- .shadow()
91
- .within(() => {
92
- Object.keys(customOrder).forEach((state) => {
93
- cy.get("ul [data-identifier]")
94
- .eq(customOrder[state])
95
- .invoke("attr", "data-identifier")
96
- .should("eq", state);
97
- });
90
+ cy.get("eox-itemfilter-multiselect > eox-selectionlist").within(() => {
91
+ Object.keys(customOrder).forEach((state) => {
92
+ cy.get("ul [data-identifier]")
93
+ .eq(customOrder[state])
94
+ .invoke("attr", "data-identifier")
95
+ .should("eq", state);
98
96
  });
97
+ });
99
98
  });
100
99
  });
101
100
  });