vue-instantsearch 4.7.2 → 4.8.1
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 +4 -4
- package/src/__tests__/common.test.js +99 -0
- package/src/components/HierarchicalMenuList.vue +2 -1
- package/src/components/Pagination.vue +1 -0
- package/src/components/__tests__/HierarchicalMenu.js +9 -0
- package/src/components/__tests__/__snapshots__/HierarchicalMenu.js.snap +94 -2
- package/src/components/__tests__/__snapshots__/Pagination.js.snap +42 -21
- package/src/util/__tests__/createServerRootMixin.test.js +8 -12
- package/vue2/cjs/index.js +1 -1
- package/vue2/cjs/index.js.map +1 -1
- package/vue2/es/package.json.js +1 -1
- package/vue2/es/src/components/HierarchicalMenuList.vue.js +1 -1
- package/vue2/es/src/components/Pagination.vue.js +1 -1
- package/vue2/umd/index.js +1 -1
- package/vue2/umd/index.js.map +1 -1
- package/vue3/cjs/index.js +1 -1
- package/vue3/cjs/index.js.map +1 -1
- package/vue3/es/package.json.js +1 -1
- package/vue3/es/src/components/HierarchicalMenuList.vue.js +1 -1
- package/vue3/es/src/components/HierarchicalMenuList.vue_vue&type=script&lang.js.map +1 -1
- package/vue3/es/src/components/HierarchicalMenuList.vue_vue&type=template&id=eb2af574&lang.js +2 -0
- package/vue3/es/src/components/HierarchicalMenuList.vue_vue&type=template&id=eb2af574&lang.js.map +1 -0
- package/vue3/es/src/components/Pagination.vue.js +1 -1
- package/vue3/es/src/components/Pagination.vue_vue&type=script&lang.js.map +1 -1
- package/vue3/es/src/components/{Pagination.vue_vue&type=template&id=189fc463&lang.js → Pagination.vue_vue&type=template&id=455c122a&lang.js} +2 -2
- package/vue3/es/src/components/Pagination.vue_vue&type=template&id=455c122a&lang.js.map +1 -0
- package/vue3/umd/index.js +1 -1
- package/vue3/umd/index.js.map +1 -1
- package/vue3/es/src/components/HierarchicalMenuList.vue_vue&type=template&id=45723c6c&lang.js +0 -2
- package/vue3/es/src/components/HierarchicalMenuList.vue_vue&type=template&id=45723c6c&lang.js.map +0 -1
- package/vue3/es/src/components/Pagination.vue_vue&type=template&id=189fc463&lang.js.map +0 -1
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"autocomplete"
|
|
17
17
|
],
|
|
18
18
|
"license": "MIT",
|
|
19
|
-
"version": "4.
|
|
19
|
+
"version": "4.8.1",
|
|
20
20
|
"files": [
|
|
21
21
|
"vue2",
|
|
22
22
|
"vue3",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"test:exports:vue3": "node ./test/module/vue3/is-es-module.mjs && node ./test/module/vue3/is-cjs-module.cjs"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"instantsearch.js": "
|
|
38
|
+
"instantsearch.js": "4.50.1",
|
|
39
39
|
"mitt": "^2.1.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@vue/test-utils": "1.3.0",
|
|
61
61
|
"@vue/test-utils2": "npm:@vue/test-utils@2.0.0-rc.11",
|
|
62
62
|
"algoliasearch": "4.14.3",
|
|
63
|
-
"algoliasearch-helper": "3.11.
|
|
63
|
+
"algoliasearch-helper": "3.11.3",
|
|
64
64
|
"instantsearch.css": "8.0.0",
|
|
65
65
|
"rollup": "1.32.1",
|
|
66
66
|
"rollup-plugin-babel": "4.4.0",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"vuex": "3.5.1",
|
|
86
86
|
"vuex4": "npm:vuex@4.0.0"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "9c696ab3244d701c05d314bb765f086a50ff481b"
|
|
89
89
|
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
createRefinementListTests,
|
|
6
|
+
createHierarchicalMenuTests,
|
|
7
|
+
createMenuTests,
|
|
8
|
+
createPaginationTests,
|
|
9
|
+
} from '@instantsearch/tests';
|
|
10
|
+
|
|
11
|
+
import { nextTick, mountApp } from '../../test/utils';
|
|
12
|
+
import { renderCompat } from '../util/vue-compat';
|
|
13
|
+
import {
|
|
14
|
+
AisInstantSearch,
|
|
15
|
+
AisRefinementList,
|
|
16
|
+
AisHierarchicalMenu,
|
|
17
|
+
AisMenu,
|
|
18
|
+
AisPagination,
|
|
19
|
+
createWidgetMixin,
|
|
20
|
+
} from '../instantsearch';
|
|
21
|
+
jest.unmock('instantsearch.js/es');
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* prevent rethrowing InstantSearch errors, so tests can be asserted.
|
|
25
|
+
* IRL this isn't needed, as the error doesn't stop execution.
|
|
26
|
+
*/
|
|
27
|
+
const GlobalErrorSwallower = {
|
|
28
|
+
mixins: [createWidgetMixin({ connector: true })],
|
|
29
|
+
mounted() {
|
|
30
|
+
this.instantSearchInstance.on('error', () => {});
|
|
31
|
+
},
|
|
32
|
+
render() {
|
|
33
|
+
return null;
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
createRefinementListTests(async ({ instantSearchOptions, widgetParams }) => {
|
|
38
|
+
mountApp(
|
|
39
|
+
{
|
|
40
|
+
render: renderCompat((h) =>
|
|
41
|
+
h(AisInstantSearch, { props: instantSearchOptions }, [
|
|
42
|
+
h(AisRefinementList, { props: widgetParams }),
|
|
43
|
+
h(GlobalErrorSwallower),
|
|
44
|
+
])
|
|
45
|
+
),
|
|
46
|
+
},
|
|
47
|
+
document.body.appendChild(document.createElement('div'))
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
await nextTick();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
createHierarchicalMenuTests(async ({ instantSearchOptions, widgetParams }) => {
|
|
54
|
+
mountApp(
|
|
55
|
+
{
|
|
56
|
+
render: renderCompat((h) =>
|
|
57
|
+
h(AisInstantSearch, { props: instantSearchOptions }, [
|
|
58
|
+
h(AisHierarchicalMenu, { props: widgetParams }),
|
|
59
|
+
h(GlobalErrorSwallower),
|
|
60
|
+
])
|
|
61
|
+
),
|
|
62
|
+
},
|
|
63
|
+
document.body.appendChild(document.createElement('div'))
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
await nextTick();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
createMenuTests(async ({ instantSearchOptions, widgetParams }) => {
|
|
70
|
+
mountApp(
|
|
71
|
+
{
|
|
72
|
+
render: renderCompat((h) =>
|
|
73
|
+
h(AisInstantSearch, { props: instantSearchOptions }, [
|
|
74
|
+
h(AisMenu, { props: widgetParams }),
|
|
75
|
+
h(GlobalErrorSwallower),
|
|
76
|
+
])
|
|
77
|
+
),
|
|
78
|
+
},
|
|
79
|
+
document.body.appendChild(document.createElement('div'))
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
await nextTick();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
createPaginationTests(async ({ instantSearchOptions, widgetParams }) => {
|
|
86
|
+
mountApp(
|
|
87
|
+
{
|
|
88
|
+
render: renderCompat((h) =>
|
|
89
|
+
h(AisInstantSearch, { props: instantSearchOptions }, [
|
|
90
|
+
h(AisPagination, { props: widgetParams }),
|
|
91
|
+
h(GlobalErrorSwallower),
|
|
92
|
+
])
|
|
93
|
+
),
|
|
94
|
+
},
|
|
95
|
+
document.body.appendChild(document.createElement('div'))
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
await nextTick();
|
|
99
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ul
|
|
3
|
+
v-if="items.length > 0"
|
|
3
4
|
:class="[
|
|
4
5
|
suit('list'),
|
|
5
6
|
level > 0 && suit('list', 'child'),
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
:key="item.value"
|
|
12
13
|
:class="[
|
|
13
14
|
suit('item'),
|
|
14
|
-
item.data && suit('item', 'parent'),
|
|
15
|
+
item.data && item.data.length > 0 && suit('item', 'parent'),
|
|
15
16
|
item.isRefined && suit('item', 'selected'),
|
|
16
17
|
]"
|
|
17
18
|
>
|
|
@@ -98,6 +98,14 @@ const microsoft = {
|
|
|
98
98
|
data: null,
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
+
const google = {
|
|
102
|
+
label: 'Google',
|
|
103
|
+
value: 'Google',
|
|
104
|
+
isRefined: true,
|
|
105
|
+
count: 2,
|
|
106
|
+
data: [],
|
|
107
|
+
};
|
|
108
|
+
|
|
101
109
|
const defaultState = {
|
|
102
110
|
items: [
|
|
103
111
|
{
|
|
@@ -116,6 +124,7 @@ const defaultState = {
|
|
|
116
124
|
data: [galaxy, note],
|
|
117
125
|
},
|
|
118
126
|
microsoft,
|
|
127
|
+
google,
|
|
119
128
|
],
|
|
120
129
|
refine: () => {},
|
|
121
130
|
createURL: () => {},
|
|
@@ -48,6 +48,13 @@ exports[`custom default render renders correctly 1`] = `
|
|
|
48
48
|
Microsoft - 20
|
|
49
49
|
</a>
|
|
50
50
|
</li>
|
|
51
|
+
<li>
|
|
52
|
+
<a>
|
|
53
|
+
Google - 2
|
|
54
|
+
</a>
|
|
55
|
+
<ol>
|
|
56
|
+
</ol>
|
|
57
|
+
</li>
|
|
51
58
|
</ol>
|
|
52
59
|
<button>
|
|
53
60
|
View more
|
|
@@ -104,6 +111,13 @@ exports[`custom default render renders correctly with a disabled show more butto
|
|
|
104
111
|
Microsoft - 20
|
|
105
112
|
</a>
|
|
106
113
|
</li>
|
|
114
|
+
<li>
|
|
115
|
+
<a>
|
|
116
|
+
Google - 2
|
|
117
|
+
</a>
|
|
118
|
+
<ol>
|
|
119
|
+
</ol>
|
|
120
|
+
</li>
|
|
107
121
|
</ol>
|
|
108
122
|
<button disabled="disabled">
|
|
109
123
|
View more
|
|
@@ -160,6 +174,13 @@ exports[`custom default render renders correctly with a limit 1`] = `
|
|
|
160
174
|
Microsoft - 20
|
|
161
175
|
</a>
|
|
162
176
|
</li>
|
|
177
|
+
<li>
|
|
178
|
+
<a>
|
|
179
|
+
Google - 2
|
|
180
|
+
</a>
|
|
181
|
+
<ol>
|
|
182
|
+
</ol>
|
|
183
|
+
</li>
|
|
163
184
|
</ol>
|
|
164
185
|
<button>
|
|
165
186
|
View more
|
|
@@ -216,6 +237,13 @@ exports[`custom default render renders correctly with a show more button toggled
|
|
|
216
237
|
Microsoft - 20
|
|
217
238
|
</a>
|
|
218
239
|
</li>
|
|
240
|
+
<li>
|
|
241
|
+
<a>
|
|
242
|
+
Google - 2
|
|
243
|
+
</a>
|
|
244
|
+
<ol>
|
|
245
|
+
</ol>
|
|
246
|
+
</li>
|
|
219
247
|
</ol>
|
|
220
248
|
<button>
|
|
221
249
|
View more
|
|
@@ -272,6 +300,13 @@ exports[`custom default render renders correctly with a show more button toggled
|
|
|
272
300
|
Microsoft - 20
|
|
273
301
|
</a>
|
|
274
302
|
</li>
|
|
303
|
+
<li>
|
|
304
|
+
<a>
|
|
305
|
+
Google - 2
|
|
306
|
+
</a>
|
|
307
|
+
<ol>
|
|
308
|
+
</ol>
|
|
309
|
+
</li>
|
|
275
310
|
</ol>
|
|
276
311
|
<button>
|
|
277
312
|
View less
|
|
@@ -328,6 +363,13 @@ exports[`custom default render renders correctly with an URL for the href 1`] =
|
|
|
328
363
|
Microsoft - 20
|
|
329
364
|
</a>
|
|
330
365
|
</li>
|
|
366
|
+
<li>
|
|
367
|
+
<a href="/categories/Google">
|
|
368
|
+
Google - 2
|
|
369
|
+
</a>
|
|
370
|
+
<ol>
|
|
371
|
+
</ol>
|
|
372
|
+
</li>
|
|
331
373
|
</ol>
|
|
332
374
|
<button>
|
|
333
375
|
View more
|
|
@@ -467,6 +509,16 @@ exports[`custom showMoreLabel render renders correctly with a custom show more l
|
|
|
467
509
|
</span>
|
|
468
510
|
</a>
|
|
469
511
|
</li>
|
|
512
|
+
<li class="ais-HierarchicalMenu-item ais-HierarchicalMenu-item--selected">
|
|
513
|
+
<a class="ais-HierarchicalMenu-link ais-HierarchicalMenu-link--selected">
|
|
514
|
+
<span class="ais-HierarchicalMenu-label">
|
|
515
|
+
Google
|
|
516
|
+
</span>
|
|
517
|
+
<span class="ais-HierarchicalMenu-count">
|
|
518
|
+
2
|
|
519
|
+
</span>
|
|
520
|
+
</a>
|
|
521
|
+
</li>
|
|
470
522
|
</ul>
|
|
471
523
|
<button class="ais-HierarchicalMenu-showMore">
|
|
472
524
|
<span>
|
|
@@ -595,6 +647,16 @@ exports[`custom showMoreLabel render renders correctly with a custom show more l
|
|
|
595
647
|
</span>
|
|
596
648
|
</a>
|
|
597
649
|
</li>
|
|
650
|
+
<li class="ais-HierarchicalMenu-item ais-HierarchicalMenu-item--selected">
|
|
651
|
+
<a class="ais-HierarchicalMenu-link ais-HierarchicalMenu-link--selected">
|
|
652
|
+
<span class="ais-HierarchicalMenu-label">
|
|
653
|
+
Google
|
|
654
|
+
</span>
|
|
655
|
+
<span class="ais-HierarchicalMenu-count">
|
|
656
|
+
2
|
|
657
|
+
</span>
|
|
658
|
+
</a>
|
|
659
|
+
</li>
|
|
598
660
|
</ul>
|
|
599
661
|
<button class="ais-HierarchicalMenu-showMore">
|
|
600
662
|
<span>
|
|
@@ -723,6 +785,16 @@ exports[`default render renders correctly 1`] = `
|
|
|
723
785
|
</span>
|
|
724
786
|
</a>
|
|
725
787
|
</li>
|
|
788
|
+
<li class="ais-HierarchicalMenu-item ais-HierarchicalMenu-item--selected">
|
|
789
|
+
<a class="ais-HierarchicalMenu-link ais-HierarchicalMenu-link--selected">
|
|
790
|
+
<span class="ais-HierarchicalMenu-label">
|
|
791
|
+
Google
|
|
792
|
+
</span>
|
|
793
|
+
<span class="ais-HierarchicalMenu-count">
|
|
794
|
+
2
|
|
795
|
+
</span>
|
|
796
|
+
</a>
|
|
797
|
+
</li>
|
|
726
798
|
</ul>
|
|
727
799
|
</div>
|
|
728
800
|
`;
|
|
@@ -991,6 +1063,18 @@ exports[`default render renders correctly with a URL for the href 1`] = `
|
|
|
991
1063
|
</span>
|
|
992
1064
|
</a>
|
|
993
1065
|
</li>
|
|
1066
|
+
<li class="ais-HierarchicalMenu-item ais-HierarchicalMenu-item--selected">
|
|
1067
|
+
<a class="ais-HierarchicalMenu-link ais-HierarchicalMenu-link--selected"
|
|
1068
|
+
href="/categories/Google"
|
|
1069
|
+
>
|
|
1070
|
+
<span class="ais-HierarchicalMenu-label">
|
|
1071
|
+
Google
|
|
1072
|
+
</span>
|
|
1073
|
+
<span class="ais-HierarchicalMenu-count">
|
|
1074
|
+
2
|
|
1075
|
+
</span>
|
|
1076
|
+
</a>
|
|
1077
|
+
</li>
|
|
994
1078
|
</ul>
|
|
995
1079
|
</div>
|
|
996
1080
|
`;
|
|
@@ -1114,6 +1198,16 @@ exports[`default render renders correctly with show more disabled 1`] = `
|
|
|
1114
1198
|
</span>
|
|
1115
1199
|
</a>
|
|
1116
1200
|
</li>
|
|
1201
|
+
<li class="ais-HierarchicalMenu-item ais-HierarchicalMenu-item--selected">
|
|
1202
|
+
<a class="ais-HierarchicalMenu-link ais-HierarchicalMenu-link--selected">
|
|
1203
|
+
<span class="ais-HierarchicalMenu-label">
|
|
1204
|
+
Google
|
|
1205
|
+
</span>
|
|
1206
|
+
<span class="ais-HierarchicalMenu-count">
|
|
1207
|
+
2
|
|
1208
|
+
</span>
|
|
1209
|
+
</a>
|
|
1210
|
+
</li>
|
|
1117
1211
|
</ul>
|
|
1118
1212
|
<button class="ais-HierarchicalMenu-showMore ais-HierarchicalMenu-showMore--disabled"
|
|
1119
1213
|
disabled="disabled"
|
|
@@ -1137,7 +1231,5 @@ exports[`default render renders correctly with show more label toggled 1`] = `
|
|
|
1137
1231
|
|
|
1138
1232
|
exports[`default render renders correctly without refinement 1`] = `
|
|
1139
1233
|
<div class="ais-HierarchicalMenu ais-HierarchicalMenu--noRefinement">
|
|
1140
|
-
<ul class="ais-HierarchicalMenu-list ais-HierarchicalMenu-list--lvl0">
|
|
1141
|
-
</ul>
|
|
1142
1234
|
</div>
|
|
1143
1235
|
`;
|
|
@@ -20,49 +20,56 @@ exports[`renders correctly another page 1`] = `
|
|
|
20
20
|
</a>
|
|
21
21
|
</li>
|
|
22
22
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
23
|
-
<a
|
|
23
|
+
<a aria-label="Page 4"
|
|
24
|
+
class="ais-Pagination-link"
|
|
24
25
|
href="#"
|
|
25
26
|
>
|
|
26
27
|
4
|
|
27
28
|
</a>
|
|
28
29
|
</li>
|
|
29
30
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
30
|
-
<a
|
|
31
|
+
<a aria-label="Page 5"
|
|
32
|
+
class="ais-Pagination-link"
|
|
31
33
|
href="#"
|
|
32
34
|
>
|
|
33
35
|
5
|
|
34
36
|
</a>
|
|
35
37
|
</li>
|
|
36
38
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
37
|
-
<a
|
|
39
|
+
<a aria-label="Page 6"
|
|
40
|
+
class="ais-Pagination-link"
|
|
38
41
|
href="#"
|
|
39
42
|
>
|
|
40
43
|
6
|
|
41
44
|
</a>
|
|
42
45
|
</li>
|
|
43
46
|
<li class="ais-Pagination-item ais-Pagination-item--page ais-Pagination-item--selected">
|
|
44
|
-
<a
|
|
47
|
+
<a aria-label="Page 7"
|
|
48
|
+
class="ais-Pagination-link"
|
|
45
49
|
href="#"
|
|
46
50
|
>
|
|
47
51
|
7
|
|
48
52
|
</a>
|
|
49
53
|
</li>
|
|
50
54
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
51
|
-
<a
|
|
55
|
+
<a aria-label="Page 8"
|
|
56
|
+
class="ais-Pagination-link"
|
|
52
57
|
href="#"
|
|
53
58
|
>
|
|
54
59
|
8
|
|
55
60
|
</a>
|
|
56
61
|
</li>
|
|
57
62
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
58
|
-
<a
|
|
63
|
+
<a aria-label="Page 9"
|
|
64
|
+
class="ais-Pagination-link"
|
|
59
65
|
href="#"
|
|
60
66
|
>
|
|
61
67
|
9
|
|
62
68
|
</a>
|
|
63
69
|
</li>
|
|
64
70
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
65
|
-
<a
|
|
71
|
+
<a aria-label="Page 10"
|
|
72
|
+
class="ais-Pagination-link"
|
|
66
73
|
href="#"
|
|
67
74
|
>
|
|
68
75
|
10
|
|
@@ -106,49 +113,56 @@ exports[`renders correctly first page 1`] = `
|
|
|
106
113
|
</span>
|
|
107
114
|
</li>
|
|
108
115
|
<li class="ais-Pagination-item ais-Pagination-item--page ais-Pagination-item--selected">
|
|
109
|
-
<a
|
|
116
|
+
<a aria-label="Page 1"
|
|
117
|
+
class="ais-Pagination-link"
|
|
110
118
|
href="#"
|
|
111
119
|
>
|
|
112
120
|
1
|
|
113
121
|
</a>
|
|
114
122
|
</li>
|
|
115
123
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
116
|
-
<a
|
|
124
|
+
<a aria-label="Page 2"
|
|
125
|
+
class="ais-Pagination-link"
|
|
117
126
|
href="#"
|
|
118
127
|
>
|
|
119
128
|
2
|
|
120
129
|
</a>
|
|
121
130
|
</li>
|
|
122
131
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
123
|
-
<a
|
|
132
|
+
<a aria-label="Page 3"
|
|
133
|
+
class="ais-Pagination-link"
|
|
124
134
|
href="#"
|
|
125
135
|
>
|
|
126
136
|
3
|
|
127
137
|
</a>
|
|
128
138
|
</li>
|
|
129
139
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
130
|
-
<a
|
|
140
|
+
<a aria-label="Page 4"
|
|
141
|
+
class="ais-Pagination-link"
|
|
131
142
|
href="#"
|
|
132
143
|
>
|
|
133
144
|
4
|
|
134
145
|
</a>
|
|
135
146
|
</li>
|
|
136
147
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
137
|
-
<a
|
|
148
|
+
<a aria-label="Page 5"
|
|
149
|
+
class="ais-Pagination-link"
|
|
138
150
|
href="#"
|
|
139
151
|
>
|
|
140
152
|
5
|
|
141
153
|
</a>
|
|
142
154
|
</li>
|
|
143
155
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
144
|
-
<a
|
|
156
|
+
<a aria-label="Page 6"
|
|
157
|
+
class="ais-Pagination-link"
|
|
145
158
|
href="#"
|
|
146
159
|
>
|
|
147
160
|
6
|
|
148
161
|
</a>
|
|
149
162
|
</li>
|
|
150
163
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
151
|
-
<a
|
|
164
|
+
<a aria-label="Page 7"
|
|
165
|
+
class="ais-Pagination-link"
|
|
152
166
|
href="#"
|
|
153
167
|
>
|
|
154
168
|
7
|
|
@@ -194,49 +208,56 @@ exports[`renders correctly last page 1`] = `
|
|
|
194
208
|
</a>
|
|
195
209
|
</li>
|
|
196
210
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
197
|
-
<a
|
|
211
|
+
<a aria-label="Page 4"
|
|
212
|
+
class="ais-Pagination-link"
|
|
198
213
|
href="#"
|
|
199
214
|
>
|
|
200
215
|
4
|
|
201
216
|
</a>
|
|
202
217
|
</li>
|
|
203
218
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
204
|
-
<a
|
|
219
|
+
<a aria-label="Page 5"
|
|
220
|
+
class="ais-Pagination-link"
|
|
205
221
|
href="#"
|
|
206
222
|
>
|
|
207
223
|
5
|
|
208
224
|
</a>
|
|
209
225
|
</li>
|
|
210
226
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
211
|
-
<a
|
|
227
|
+
<a aria-label="Page 6"
|
|
228
|
+
class="ais-Pagination-link"
|
|
212
229
|
href="#"
|
|
213
230
|
>
|
|
214
231
|
6
|
|
215
232
|
</a>
|
|
216
233
|
</li>
|
|
217
234
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
218
|
-
<a
|
|
235
|
+
<a aria-label="Page 7"
|
|
236
|
+
class="ais-Pagination-link"
|
|
219
237
|
href="#"
|
|
220
238
|
>
|
|
221
239
|
7
|
|
222
240
|
</a>
|
|
223
241
|
</li>
|
|
224
242
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
225
|
-
<a
|
|
243
|
+
<a aria-label="Page 8"
|
|
244
|
+
class="ais-Pagination-link"
|
|
226
245
|
href="#"
|
|
227
246
|
>
|
|
228
247
|
8
|
|
229
248
|
</a>
|
|
230
249
|
</li>
|
|
231
250
|
<li class="ais-Pagination-item ais-Pagination-item--page">
|
|
232
|
-
<a
|
|
251
|
+
<a aria-label="Page 9"
|
|
252
|
+
class="ais-Pagination-link"
|
|
233
253
|
href="#"
|
|
234
254
|
>
|
|
235
255
|
9
|
|
236
256
|
</a>
|
|
237
257
|
</li>
|
|
238
258
|
<li class="ais-Pagination-item ais-Pagination-item--page ais-Pagination-item--selected">
|
|
239
|
-
<a
|
|
259
|
+
<a aria-label="Page 10"
|
|
260
|
+
class="ais-Pagination-link"
|
|
240
261
|
href="#"
|
|
241
262
|
>
|
|
242
263
|
10
|
|
@@ -1133,6 +1133,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/instantsear
|
|
|
1133
1133
|
|
|
1134
1134
|
const resultsState = createSerializedState();
|
|
1135
1135
|
const state = new SearchParameters(resultsState.state);
|
|
1136
|
+
const localState = new SearchParameters({ index: 'lol' });
|
|
1136
1137
|
const results = new SearchResults(state, resultsState.results);
|
|
1137
1138
|
|
|
1138
1139
|
instantSearchInstance.hydrate({
|
|
@@ -1149,18 +1150,13 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/instantsear
|
|
|
1149
1150
|
|
|
1150
1151
|
const renderArgs = widget.render.mock.calls[0][0];
|
|
1151
1152
|
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
results,
|
|
1160
|
-
}),
|
|
1161
|
-
],
|
|
1162
|
-
})
|
|
1163
|
-
);
|
|
1153
|
+
// renders with local state, not the one from results
|
|
1154
|
+
expect(renderArgs.state).toEqual(localState);
|
|
1155
|
+
results._state = localState;
|
|
1156
|
+
expect(renderArgs.results).toEqual(results);
|
|
1157
|
+
expect(renderArgs.scopedResults).toHaveLength(1);
|
|
1158
|
+
expect(renderArgs.scopedResults[0].indexId).toEqual('lol');
|
|
1159
|
+
expect(renderArgs.scopedResults[0].results).toEqual(results);
|
|
1164
1160
|
});
|
|
1165
1161
|
|
|
1166
1162
|
describe('createURL', () => {
|