@eox/itemfilter 1.3.0 → 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.
Files changed (76) hide show
  1. package/README.md +4 -0
  2. package/dist/eox-itemfilter.js +1156 -1276
  3. package/dist/eox-itemfilter.umd.cjs +110 -112
  4. package/package.json +8 -13
  5. package/src/components/chips.js +131 -0
  6. package/src/components/expand-container.js +94 -0
  7. package/src/components/filters/range.js +114 -0
  8. package/src/components/filters/selector.js +245 -0
  9. package/src/components/filters/spatial.js +192 -0
  10. package/src/components/filters/text.js +114 -0
  11. package/src/components/itemfilter-container.js +289 -0
  12. package/src/components/results.js +156 -0
  13. package/src/enums/config.js +104 -0
  14. package/src/enums/index.js +1 -0
  15. package/src/helpers/chip-items.js +19 -0
  16. package/src/helpers/filter-client.js +179 -0
  17. package/src/helpers/filter-external.js +18 -0
  18. package/src/helpers/get-value.js +12 -0
  19. package/src/helpers/highlighting.js +79 -0
  20. package/src/helpers/index.js +11 -0
  21. package/src/helpers/is-filters-dirty.js +13 -0
  22. package/src/helpers/map-layers.js +42 -0
  23. package/src/helpers/reset-filter.js +60 -0
  24. package/src/helpers/spatial.js +35 -0
  25. package/src/helpers/tab-index.js +13 -0
  26. package/src/helpers/toggle-accordion.js +39 -0
  27. package/src/main.js +466 -0
  28. package/src/methods/chips/handler.js +129 -0
  29. package/src/methods/chips/index.js +5 -0
  30. package/src/methods/container/handler.js +70 -0
  31. package/src/methods/container/index.js +10 -0
  32. package/src/methods/container/init-popver.js +34 -0
  33. package/src/methods/container/reset-filter.js +14 -0
  34. package/src/methods/container/reset-search.js +16 -0
  35. package/src/methods/container/search-filter.js +27 -0
  36. package/src/methods/filters/index.js +20 -0
  37. package/src/methods/filters/range.js +78 -0
  38. package/src/methods/filters/selector.js +209 -0
  39. package/src/methods/filters/spatial.js +114 -0
  40. package/src/methods/filters/text.js +32 -0
  41. package/src/methods/itemfilter/create-filter.js +83 -0
  42. package/src/methods/itemfilter/create-reset.js +39 -0
  43. package/src/methods/itemfilter/filter-apply.js +140 -0
  44. package/src/methods/itemfilter/index.js +6 -0
  45. package/src/methods/itemfilter/reset-filter.js +13 -0
  46. package/src/methods/itemfilter/search.js +23 -0
  47. package/src/methods/itemfilter/sort-results.js +14 -0
  48. package/src/methods/results/aggregate-results.js +43 -0
  49. package/src/methods/results/create.js +111 -0
  50. package/src/methods/results/index.js +2 -0
  51. package/src/style.eox.js +457 -0
  52. package/src/style.js +26 -0
  53. package/test/_mockMap.js +0 -20
  54. package/test/cases/filters/filter-keys.js +0 -22
  55. package/test/cases/filters/index.js +0 -3
  56. package/test/cases/general/accordion.js +0 -60
  57. package/test/cases/general/disable-highlight.js +0 -21
  58. package/test/cases/general/external-filter.js +0 -35
  59. package/test/cases/general/highlight-result.js +0 -16
  60. package/test/cases/general/index.js +0 -13
  61. package/test/cases/general/multiple-filters.js +0 -21
  62. package/test/cases/general/nested-property.js +0 -25
  63. package/test/cases/general/search-bar.js +0 -12
  64. package/test/cases/general/search-result.js +0 -14
  65. package/test/cases/general/spatial-filter.js +0 -22
  66. package/test/cases/general/subtitle.js +0 -15
  67. package/test/cases/general/validation.js +0 -22
  68. package/test/cases/state/custom-order.js +0 -24
  69. package/test/cases/state/index.js +0 -6
  70. package/test/cases/state/render-checkbox.js +0 -17
  71. package/test/cases/state/result-pre-checked.js +0 -20
  72. package/test/cases/state/results-with-pre-set-filters.js +0 -30
  73. package/test/filters.cy.js +0 -54
  74. package/test/general.cy.js +0 -110
  75. package/test/state.cy.js +0 -74
  76. package/test/testItems.json +0 -440
@@ -0,0 +1,457 @@
1
+ export const styleEOX = `
2
+ :host, :root {
3
+ --item-color: color-mix(
4
+ in srgb,
5
+ var(--primary-color) 10%,
6
+ transparent
7
+ );
8
+ --item-hover-color: color-mix(
9
+ in srgb,
10
+ var(--secondary-color) 30%,
11
+ transparent
12
+ );
13
+ --item-select-color: var(--primary-color);
14
+ --inline-bg-color: color-mix(
15
+ in srgb,
16
+ var(--secondary-color) 10%,
17
+ transparent
18
+ );
19
+ --border-color: color-mix(
20
+ in srgb,
21
+ #000000 20%,
22
+ transparent
23
+ );
24
+ --background-color: #fff;
25
+ --padding: 0.5rem;
26
+ --text-transform: capitalize;
27
+ }
28
+ * {
29
+ font-family: Roboto, sans-serif;
30
+ }
31
+ ul {
32
+ padding-left: 0;
33
+ margin-top: 0;
34
+ }
35
+ li {
36
+ list-style: none;
37
+ }
38
+ li span {
39
+ text-overflow: ellipsis;
40
+ white-space: nowrap;
41
+ }
42
+ li label {
43
+ display: flex;
44
+ align-items: center;
45
+ }
46
+ details summary > * {
47
+ display: inline;
48
+ }
49
+ details summary {
50
+ display: flex;
51
+ align-items: center;
52
+ border-bottom: 1px solid #0002;
53
+ padding: .5rem var(--padding);
54
+ }
55
+
56
+ details > summary::-webkit-details-marker {
57
+ display: none;
58
+ }
59
+
60
+ .title {
61
+ font-size: 13px;
62
+ align-items: center;
63
+ text-transform: var(--text-transform);
64
+ }
65
+ .subtitle {
66
+ font-size: 11px;
67
+ opacity: .7;
68
+ margin-top: 6px;
69
+ }
70
+ .title-container {
71
+ display: flex;
72
+ flex-direction: column;
73
+ }
74
+ h6.main-heading {
75
+ font-size: 1rem;
76
+ margin-block-start: 1.33em;
77
+ margin-block-end: 1.33em;
78
+ margin-top: var(--padding);
79
+ padding: 0 var(--padding);
80
+ }
81
+ details summary .title {
82
+ display: flex;
83
+ font-weight: 500;
84
+ }
85
+ details.details-filter summary::after,
86
+ details.details-results summary::before {
87
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230009' viewBox='0 0 24 24'%3E%3Ctitle%3Echevron-right%3C/title%3E%3Cpath d='M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z' /%3E%3C/svg%3E");
88
+ height: 24px;
89
+ width: 24px;
90
+ }
91
+ details.details-filter summary::after {
92
+ position: absolute;
93
+ right: 8px;
94
+ transform: rotate(90deg);
95
+ }
96
+ details[open] summary::before {
97
+ transform: rotate(90deg);
98
+ }
99
+ details[open] summary::after {
100
+ transform: rotate(270deg);
101
+ }
102
+ eox-itemfilter-expandcontainer {
103
+ max-height: 200px;
104
+ }
105
+ eox-itemfilter-expandcontainer > [data-type=filter] {
106
+ display: block;
107
+ height: calc(100% - 32px);
108
+ overflow-y: auto;
109
+ overflow-x: hidden;
110
+ padding: 0 var(--padding);
111
+ }
112
+ [data-type=filter] .title,
113
+ details summary {
114
+ text-transform: var(--text-transform);
115
+ }
116
+ li,
117
+ label,
118
+ details,
119
+ input[type="checkbox"],
120
+ input[type="radio"] {
121
+ cursor: pointer;
122
+ }
123
+ input[type="checkbox"],
124
+ input[type="radio"] {
125
+ margin: 0;
126
+ }
127
+ input[type="text"] {
128
+ box-sizing: border-box;
129
+ width: 100%;
130
+ margin-top: 0.5rem;
131
+ margin-bottom: 0.5rem;
132
+ padding: 5px 7px;
133
+ border-radius: 4px;
134
+ border: 1px solid var(--border-color);
135
+ }
136
+ section:not(section:last-of-type) {
137
+ margin-bottom: 1rem;
138
+ }
139
+ #section-results {
140
+ overflow: hidden;
141
+ flex: 1;
142
+ display: flex;
143
+ flex-direction: column;
144
+ }
145
+ ul:not(#filters) > li {
146
+ padding: 5px 0;
147
+ }
148
+ ul#results li {
149
+ padding: 5px var(--padding);
150
+ }
151
+ section {
152
+ position: relative;
153
+ background-color: var(--background-color);
154
+ }
155
+ button#filter-reset {
156
+ position: absolute;
157
+ top: 0;
158
+ right: var(--padding);
159
+ padding: 2px 10px;
160
+ }
161
+ .count {
162
+ display: flex;
163
+ justify-content: center;
164
+ align-items: center;
165
+ background: var(--secondary-color);
166
+ padding: 0 12px;
167
+ height: 20px;
168
+ border-radius: 10px;
169
+ color: var(--primary-color);
170
+ font-weight: 500;
171
+ margin-left: 9px;
172
+ }
173
+ eox-itemfilter-range,
174
+ tc-range-slider {
175
+ align-items: center;
176
+ display: block;
177
+ }
178
+ tc-range-slider {
179
+ width: calc(100% - 16px);
180
+ margin-left: 8px;
181
+ margin-right: 8px;
182
+ --width: 100%;
183
+ }
184
+ .range-before,
185
+ .range-after {
186
+ font-size: small;
187
+ }
188
+ .range-before,
189
+ .range-after {
190
+ margin: 1rem 0px;
191
+ }
192
+
193
+ button.reset-icon:before {
194
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eclose%3C/title%3E%3Cpath d='M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z' /%3E%3C/svg%3E");
195
+ }
196
+ eox-itemfilter-expandcontainer button.reset-icon {
197
+ margin-left: 4px;
198
+ margin-top: -5px;
199
+ height: 14px;
200
+ width: 14px;
201
+ }
202
+ eox-itemfilter-expandcontainer button.reset-icon:before {
203
+ height: 14px;
204
+ width: 14px;
205
+ }
206
+ .inline-content {
207
+ border: 1.5px solid var(--secondary-color);
208
+ border-radius: 4px;
209
+ max-height: 300px;
210
+ overflow-y: auto;
211
+ background: var(--inline-bg-color);
212
+ margin-top: 4px;
213
+ padding: 8px;
214
+ }
215
+ .inline-container {
216
+ position: relative;
217
+ align-items: center;
218
+ }
219
+ .inline-container-wrapper {
220
+ width: 100%;
221
+ position: relative;
222
+ }
223
+ .inline-container {
224
+ position: relative;
225
+ border: 1px solid var(--border-color);
226
+ border-radius: 4px;
227
+ height: 24px;
228
+ padding: 8px;
229
+ flex: 1;
230
+ justify-content: space-between;
231
+ cursor: text;
232
+ transition: all 0.2s ease-in-out;
233
+ display: flex;
234
+ }
235
+ .inline-container:hover {
236
+ border: 1px solid var(--primary-color);
237
+ }
238
+ [popover] {
239
+ position: fixed;
240
+ top: 0;
241
+ left: 0;
242
+ margin: 0;
243
+ padding: 0;
244
+ background-color: var(--background-color);
245
+ border: none;
246
+ }
247
+ .input-container {
248
+ display: flex;
249
+ flex: 1;
250
+ align-items: center;
251
+ }
252
+ .input-container input,
253
+ .input-container input:focus {
254
+ height: 100%;
255
+ border: none;
256
+ outline: none;
257
+ border: 0;
258
+ min-width: 25%;
259
+ }
260
+ .button-container {
261
+ display: flex;
262
+ align-items: center;
263
+ justify-content: center;
264
+ position: absolute;
265
+ right: 1px;
266
+ top: 5px;
267
+ height: calc(100% - 10px);
268
+ width: 34px;
269
+ background: white;
270
+ }
271
+ button.icon {
272
+ color: #004170;
273
+ height: 24px;
274
+ font-size: large;
275
+ width: unset;
276
+ }
277
+ .inline-container::-webkit-scrollbar {
278
+ height: 2px;
279
+ }
280
+ .inline-container::-webkit-scrollbar-thumb {
281
+ background: lightgrey;
282
+ border-radius: 2px;
283
+ }
284
+ .hidden {
285
+ height: 0;
286
+ padding: 0;
287
+ border: none;
288
+ }
289
+ .hidden:hover {
290
+ border: none;
291
+ }
292
+ .chip-title {
293
+ pointer-events: none;
294
+ text-transform: var(--text-transform);
295
+ }
296
+ .chip {
297
+ display: flex;
298
+ align-items: center;
299
+ background: var(--item-color);
300
+ border-radius: 30px;
301
+ margin-right: 4px;
302
+ padding: 5px 10px;
303
+ font-size: small;
304
+ cursor: default;
305
+ white-space: nowrap;
306
+ }
307
+ .chip.highlighted {
308
+ background: var(--primary-color);
309
+ color: white;
310
+ }
311
+ .chip-close {
312
+ cursor: pointer;
313
+ font-weight: 600;
314
+ position: absolute;
315
+ right: -25px;
316
+ background: white;
317
+ top: 0;
318
+ height: 100%;
319
+ display: flex;
320
+ align-items: center;
321
+ height: 24px;
322
+ width: 24px;
323
+ }
324
+ .chip-close:before {
325
+ position: absolute;
326
+ text-indent: 0;
327
+ line-height: initial;
328
+ height: 24px;
329
+ width: 24px;
330
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eclose%3C/title%3E%3Cpath d='M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z' /%3E%3C/svg%3E");
331
+ }
332
+ .chip-container {
333
+ position: relative;
334
+ max-width: 75%;
335
+ }
336
+ .autocomplete-container,
337
+ .text-container {
338
+ position: relative;
339
+ align-items: center;
340
+ width: 100%;
341
+ box-sizing: border-box;
342
+ justify-content: space-between;
343
+ cursor: text;
344
+ margin-top: 0.5rem;
345
+ margin-bottom: 0.5rem;
346
+ background: white;
347
+ }
348
+ .autocomplete-container-wrapper,
349
+ .text-container-wrapper {
350
+ position: relative;
351
+ display: flex;
352
+ align-items: center;
353
+ flex: 1;
354
+ overflow-x: auto;
355
+ -ms-overflow-style: none;
356
+ scrollbar-width: none;
357
+ }
358
+ .autocomplete-container-wrapper::-webkit-scrollbar {
359
+ display: none;
360
+ }
361
+ .chip-wrapper {
362
+ -ms-overflow-style: none;
363
+ scrollbar-width: none;
364
+ }
365
+ .chip-wrapper::-webkit-scrollbar {
366
+ display: none;
367
+ width: 0;
368
+ background: transparent;
369
+ }
370
+ .autocomplete-input,
371
+ .text-input {
372
+ flex: 1;
373
+ border: 1px solid var(--border-color);
374
+ outline: none;
375
+ box-sizing: border-box;
376
+ margin-top: 0 !important;
377
+ margin-bottom: 0 !important;
378
+ min-width: 150px;
379
+ }
380
+ input[type="text"].text-input,
381
+ input[type="text"].autocomplete-input {
382
+ padding: 9px 6px !important;
383
+ border-radius: 4px;
384
+ }
385
+ .text-input:hover,
386
+ .autocomplete-input:hover {
387
+ border: 1px solid var(--primary-color);
388
+ }
389
+ .text-input:invalid {
390
+ border: 1px solid red;
391
+ }
392
+ .selected-items {
393
+ display: flex;
394
+ flex-wrap: nowrap;
395
+ gap: 4px;
396
+ }
397
+ .select li:hover,
398
+ .multiselect li:hover,
399
+ eox-itemfilter-results li:hover {
400
+ background: var(--item-hover-color);
401
+ }
402
+ eox-itemfilter-results li.highlighted {
403
+ color: var(--background-color);
404
+ background: var(--item-select-color);
405
+ }
406
+ .selected-item span {
407
+ margin-right: 8px;
408
+ }
409
+ .selected-item button {
410
+ background: none;
411
+ border: none;
412
+ color: #fff;
413
+ cursor: pointer;
414
+ font-size: 16px;
415
+ line-height: 1;
416
+ }
417
+ .multiselect-container,
418
+ .select-container {
419
+ display: flex;
420
+ flex-direction: column;
421
+ gap: 4px;
422
+ }
423
+ .multiselect-container label,
424
+ .select-container label {
425
+ display: flex;
426
+ align-items: center;
427
+ cursor: pointer;
428
+ }
429
+ .multiselect-container input,
430
+ .select-container input {
431
+ margin-right: 8px;
432
+ }
433
+ .select-overflow {
434
+ max-height: 185px;
435
+ overflow-y: auto;
436
+ }
437
+ .chip-title strong {
438
+ font-weight: 500;
439
+ }
440
+ .chip-wrapper {
441
+ max-width: 100%;
442
+ overflow-x: scroll;
443
+ }
444
+ .chip-container {
445
+ display: flex;
446
+ flex: 0;
447
+ }
448
+ .input-container.dirty-filter-input {
449
+ margin-left: 25px;
450
+ }
451
+ .error-validation {
452
+ position: relative;
453
+ color: red;
454
+ font-size: x-small;
455
+ top: -8px;
456
+ }
457
+ `;
package/src/style.js ADDED
@@ -0,0 +1,26 @@
1
+ export const style = `
2
+ :host {
3
+ display: flex;
4
+ box-sizing: border-box;
5
+ height: 100%;
6
+ line-height: 1;
7
+ }
8
+ *,
9
+ *:before,
10
+ *:after {
11
+ box-sizing: inherit;
12
+ }
13
+ form#itemfilter {
14
+ height: 100%;
15
+ width: 100%;
16
+ max-width: 100%;
17
+ display: flex;
18
+ flex-direction: column;
19
+ }
20
+ form#itemfilter:not(.inline) {
21
+ overflow-y: auto;
22
+ }
23
+ details {
24
+ width: 100%;
25
+ }
26
+ `;
package/test/_mockMap.js DELETED
@@ -1,20 +0,0 @@
1
- export class MockMap extends HTMLElement {
2
- constructor() {
3
- super();
4
- this.attachShadow({ mode: "open" });
5
- const canvas = document.createElement("canvas");
6
- this.shadowRoot.appendChild(canvas);
7
- }
8
- addDraw() {}
9
- interactions = {
10
- drawInteraction: {
11
- on: () => {},
12
- },
13
- drawInteraction_modify: {
14
- on: () => {},
15
- },
16
- };
17
- removeInteraction() {}
18
- setLayers() {}
19
- }
20
- customElements.define("eox-map", MockMap);
@@ -1,22 +0,0 @@
1
- /**
2
- * Tests the `filterKeys` options within the `filterObject`.
3
- * It verifies that the `filterKeys` override the normally rendered filter keys.
4
- *
5
- * @param {Array} filterKeys - An array including the custom filter keys.
6
- */
7
- const filterKeysTest = (filterKeys) => {
8
- cy.get("eox-itemfilter")
9
- .shadow()
10
- .within(() => {
11
- cy.get("eox-itemfilter-select")
12
- .should("be.visible")
13
- .shadow()
14
- .within(($el) => {
15
- const identifiers = $el[0].querySelectorAll("li[data-identifier");
16
- expect(identifiers.length).to.eq(filterKeys.length);
17
- expect(identifiers[0].dataset.identifier).to.eq(filterKeys[0]);
18
- });
19
- });
20
- };
21
-
22
- export default filterKeysTest;
@@ -1,3 +0,0 @@
1
- // Exported test methods
2
-
3
- export { default as filterkeysTest } from "./filter-keys";
@@ -1,60 +0,0 @@
1
- /**
2
- * Tests the accordion functionality of the eox-itemfilter component to ensure only one accordion is open at a time.
3
- */
4
- const accordionTest = () => {
5
- // Set the configuration to disable multiple filters and results expansion
6
- cy.get("eox-itemfilter").then(($el) => {
7
- $el[0].expandMultipleFilters = false;
8
- $el[0].expandMultipleResults = false;
9
- });
10
-
11
- /**
12
- * Checks that only one accordion is open at a time for the given selector.
13
- *
14
- * @param {string} selector - The CSS selector for the accordion elements.
15
- * @param {boolean} isSubcomponent - Flag indicating if the selector targets subcomponents.
16
- */
17
- const checkExclusiveOpen = (selector, isSubcomponent) => {
18
- cy.get("eox-itemfilter")
19
- .shadow()
20
- .within(() => {
21
- cy.get(selector).then((accordions) => {
22
- for (let i = 0; i < accordions.length; i++) {
23
- const accordionToClick = isSubcomponent
24
- ? cy
25
- .get(selector)
26
- .eq(i)
27
- .find("eox-itemfilter-expandcontainer")
28
- .shadow()
29
- .find("details")
30
- : cy.get(selector).eq(i).find("details");
31
-
32
- accordionToClick.click({ multiple: true, force: true });
33
- accordionToClick.should("have.attr", "open");
34
-
35
- // Check that all other accordions are closed
36
- for (let j = 0; j < accordions.length; j++) {
37
- if (i !== j) {
38
- const accordionToCheck = isSubcomponent
39
- ? cy
40
- .get(selector)
41
- .eq(j)
42
- .find("eox-itemfilter-expandcontainer")
43
- .shadow()
44
- .find("details")
45
- : cy.get(selector).eq(j).find("details");
46
-
47
- accordionToCheck.should("not.have.attr", "open");
48
- }
49
- }
50
- }
51
- });
52
- });
53
- };
54
-
55
- // Check exclusive open behavior for filters and results
56
- checkExclusiveOpen("ul#filters", true);
57
- checkExclusiveOpen("ul#results");
58
- };
59
-
60
- export default accordionTest;
@@ -1,21 +0,0 @@
1
- /**
2
- * Tests the behavior of the eox-itemfilter-select component to ensure checkboxes can be toggled correctly.
3
- */
4
- const disableHighlightTest = () => {
5
- cy.get("eox-itemfilter")
6
- .shadow()
7
- .within(() => {
8
- cy.get("eox-itemfilter-select")
9
- .shadow()
10
- .within(() => {
11
- cy.get('[type="checkbox"]').first().check();
12
- cy.get('[type="checkbox"]').eq(1).check();
13
- cy.get('[type="checkbox"]').first().check();
14
- cy.get('[type="checkbox"]').first().should("be.checked");
15
- cy.get('[type="checkbox"]').eq(1).check();
16
- cy.get('[type="checkbox"]').eq(1).should("be.checked");
17
- });
18
- });
19
- };
20
-
21
- export default disableHighlightTest;
@@ -1,35 +0,0 @@
1
- import testItems from "../../testItems.json";
2
-
3
- /**
4
- * Tests the external filtering functionality in the eox-itemfilter component.
5
- */
6
- const externalFilterTest = () => {
7
- cy.intercept("https://external-api-url.com", [{ ...testItems[5] }]);
8
-
9
- cy.get("eox-itemfilter").then(($el) => {
10
- $el[0].externalFilter = (items, filter) => {
11
- expect(filter.themes.dirty).to.be.equal($el[0].filters.themes.dirty);
12
- return "https://external-api-url.com";
13
- };
14
- });
15
-
16
- cy.get("eox-itemfilter")
17
- .shadow()
18
- .within(() => {
19
- cy.get("[data-details=themes]").within(() => {
20
- cy.get("eox-itemfilter-select")
21
- .shadow()
22
- .within(() => {
23
- cy.get("[data-title=agriculture]").click();
24
- });
25
- });
26
- cy.get("eox-itemfilter-results summary .title")
27
- .first()
28
- .contains(testItems[5].themes[0]);
29
- cy.get("eox-itemfilter-results li .title")
30
- .first()
31
- .contains(testItems[5].title);
32
- });
33
- };
34
-
35
- export default externalFilterTest;
@@ -1,16 +0,0 @@
1
- /**
2
- * Tests the highlighting functionality in the eox-itemfilter-results component.
3
- * It types a search query and checks if the expected text is highlighted.
4
- */
5
- const highlightResultTest = () => {
6
- cy.get("eox-itemfilter")
7
- .shadow()
8
- .within(() => {
9
- cy.get("[data-cy='search']").type("white");
10
- cy.get("eox-itemfilter-results").within(() => {
11
- cy.get("mark.highlight").contains("White");
12
- });
13
- });
14
- };
15
-
16
- export default highlightResultTest;
@@ -1,13 +0,0 @@
1
- // Exported test methods
2
-
3
- export { default as searchBarTest } from "./search-bar";
4
- export { default as searchResultTest } from "./search-result";
5
- export { default as highlightResultTest } from "./highlight-result";
6
- export { default as multipleResultTest } from "./multiple-filters";
7
- export { default as disableHighlightTest } from "./disable-highlight";
8
- export { default as accordionTest } from "./accordion";
9
- export { default as spatialFilterTest } from "./spatial-filter";
10
- export { default as externalFilterTest } from "./external-filter";
11
- export { default as nestedPropertyTest } from "./nested-property";
12
- export { default as subtitleTest } from "./subtitle";
13
- export { default as validationTest } from "./validation";
@@ -1,21 +0,0 @@
1
- /**
2
- * Tests the behavior of the eox-itemfilter-select component to ensure multiple checkboxes can be toggled correctly.
3
- */
4
- const multipleResultTest = () => {
5
- cy.get("eox-itemfilter")
6
- .shadow()
7
- .within(() => {
8
- cy.get("eox-itemfilter-select")
9
- .shadow()
10
- .within(() => {
11
- cy.get('[type="checkbox"]').first().check();
12
- cy.get('[type="checkbox"]').eq(1).check();
13
- cy.get('[type="checkbox"]').first().check();
14
- cy.get('[type="checkbox"]').first().should("be.checked");
15
- cy.get('[type="checkbox"]').eq(1).check();
16
- cy.get('[type="checkbox"]').eq(1).should("be.checked");
17
- });
18
- });
19
- };
20
-
21
- export default multipleResultTest;