@blaze-cms/react-page-builder 0.132.0 → 0.133.0-admin-updates.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/CHANGELOG.md +13 -0
- package/lib/components/Banner/BannerRender.js +2 -2
- package/lib/components/Banner/BannerRender.js.map +1 -1
- package/lib/components/Banner/helpers.js +2 -2
- package/lib/components/Banner/helpers.js.map +1 -1
- package/lib/components/BlazeLink.js +2 -2
- package/lib/components/BlazeLink.js.map +1 -1
- package/lib/components/Button.js +2 -2
- package/lib/components/Button.js.map +1 -1
- package/lib/components/Card/CardsContainer.js +2 -2
- package/lib/components/Card/CardsContainer.js.map +1 -1
- package/lib/components/Card/CardsRender.js +2 -2
- package/lib/components/Card/CardsRender.js.map +1 -1
- package/lib/components/Card/helpers/filter-query-setup.js +11 -5
- package/lib/components/Card/helpers/filter-query-setup.js.map +1 -1
- package/lib/components/ClickWrapper.js +2 -2
- package/lib/components/ClickWrapper.js.map +1 -1
- package/lib/components/Code/Code.js +2 -2
- package/lib/components/Code/Code.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-loop-props-content.js +3 -2
- package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-link-to-published-content.js +2 -0
- package/lib/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
- package/lib/components/Image/Image.js +2 -2
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/Layout/Layout.js +2 -2
- package/lib/components/Layout/Layout.js.map +1 -1
- package/lib/components/List/ListBuilder.js +46 -26
- package/lib/components/List/ListBuilder.js.map +1 -1
- package/lib/components/List/ListFactory.js +5 -5
- package/lib/components/List/ListFactory.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRender.js +2 -2
- package/lib/components/List/components/Cards/CardsRender.js.map +1 -1
- package/lib/components/List/components/Full/FullRender.js +2 -2
- package/lib/components/List/components/Full/FullRender.js.map +1 -1
- package/lib/components/List/components/Full/FullRenderItem.js +2 -2
- package/lib/components/List/components/Full/FullRenderItem.js.map +1 -1
- package/lib/components/List/components/Pagination/ListPagination.js +2 -2
- package/lib/components/List/components/Pagination/ListPagination.js.map +1 -1
- package/lib/components/List/helpers/build-az-url.js +2 -2
- package/lib/components/List/helpers/build-az-url.js.map +1 -1
- package/lib/components/List/helpers/build-pagination-url.js +2 -2
- package/lib/components/List/helpers/build-pagination-url.js.map +1 -1
- package/lib/components/List/helpers/get-list-query.js +6 -2
- package/lib/components/List/helpers/get-list-query.js.map +1 -1
- package/lib/components/List/helpers/get-sort-props.js +5 -1
- package/lib/components/List/helpers/get-sort-props.js.map +1 -1
- package/lib/components/SearchFilter/components/Range.js +2 -2
- package/lib/components/SearchFilter/components/Range.js.map +1 -1
- package/lib/components/SearchFilter/searchFilterReducer.js +2 -2
- package/lib/components/SearchFilterSort/helpers/update-sort.js +2 -2
- package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
- package/lib/components/TextBlock/index.js +2 -2
- package/lib/components/TextBlock/index.js.map +1 -1
- package/lib/components/Video/Video.js +2 -2
- package/lib/components/Video/Video.js.map +1 -1
- package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js +2 -2
- package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js.map +1 -1
- package/lib/constants/index.js +4 -34
- package/lib/constants/index.js.map +1 -1
- package/lib/helpers/append-images.js +2 -2
- package/lib/helpers/build-az-filter.js +8 -7
- package/lib/helpers/build-az-filter.js.map +1 -1
- package/lib/helpers/build-raw-query-base.js +2 -2
- package/lib/helpers/build-raw-query-base.js.map +1 -1
- package/lib/helpers/build-raw-query.js +29 -8
- package/lib/helpers/build-raw-query.js.map +1 -1
- package/lib/helpers/build-sort-values.js +49 -0
- package/lib/helpers/build-sort-values.js.map +1 -0
- package/lib/helpers/get-banner-data.js +2 -2
- package/lib/helpers/get-click-wrapper-options.js +2 -2
- package/lib/helpers/get-click-wrapper-options.js.map +1 -1
- package/lib/helpers/get-entities-with-banner.js +2 -2
- package/lib/helpers/get-entities-with-banner.js.map +1 -1
- package/lib/helpers/get-extra-az-bits.js +46 -3
- package/lib/helpers/get-extra-az-bits.js.map +1 -1
- package/lib/helpers/get-generic-props.js +2 -2
- package/lib/helpers/get-generic-props.js.map +1 -1
- package/lib/helpers/get-generic-render-variables.js +30 -37
- package/lib/helpers/get-generic-render-variables.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js +2 -2
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js.map +1 -1
- package/lib/helpers/process-data-summary-value.js +2 -2
- package/lib/helpers/process-data-summary-value.js.map +1 -1
- package/lib/helpers/remove-unwanted-characters.js +2 -2
- package/lib/helpers/render-children.js +2 -2
- package/lib/helpers/render-children.js.map +1 -1
- package/lib/helpers/split-children.js +2 -2
- package/lib/helpers/update-childrens-parent.js +2 -2
- package/lib/hooks/helpers/append-gtm-classname.js +2 -2
- package/lib/hooks/helpers/append-gtm-classname.js.map +1 -1
- package/lib/hooks/helpers/buildPBComponents.js +2 -2
- package/lib/hooks/helpers/buildPBComponents.js.map +1 -1
- package/lib/hooks/helpers/get-lightbox-images.js +2 -2
- package/lib/hooks/helpers/get-lightbox-images.js.map +1 -1
- package/lib/hooks/helpers/inject-element-banners.js +2 -2
- package/lib/hooks/helpers/inject-element-banners.js.map +1 -1
- package/lib/hooks/helpers/inject-textblock-banners.js +2 -2
- package/lib/hooks/helpers/inject-textblock-banners.js.map +1 -1
- package/lib/utils/get-class-modifiers.js +2 -2
- package/lib/utils/get-class-modifiers.js.map +1 -1
- package/lib-es/components/Banner/BannerRender.js +2 -2
- package/lib-es/components/Banner/helpers.js +2 -2
- package/lib-es/components/BlazeLink.js +2 -2
- package/lib-es/components/Button.js +2 -2
- package/lib-es/components/Card/CardsContainer.js +2 -2
- package/lib-es/components/Card/CardsRender.js +2 -2
- package/lib-es/components/Card/helpers/filter-query-setup.js +11 -5
- package/lib-es/components/Card/helpers/filter-query-setup.js.map +1 -1
- package/lib-es/components/ClickWrapper.js +2 -2
- package/lib-es/components/Code/Code.js +2 -2
- package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +3 -2
- package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
- package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js +2 -1
- package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
- package/lib-es/components/Image/Image.js +2 -2
- package/lib-es/components/Layout/Layout.js +2 -2
- package/lib-es/components/List/ListBuilder.js +46 -26
- package/lib-es/components/List/ListBuilder.js.map +1 -1
- package/lib-es/components/List/ListFactory.js +5 -5
- package/lib-es/components/List/ListFactory.js.map +1 -1
- package/lib-es/components/List/components/Cards/CardsRender.js +2 -2
- package/lib-es/components/List/components/Full/FullRender.js +2 -2
- package/lib-es/components/List/components/Full/FullRenderItem.js +2 -2
- package/lib-es/components/List/components/Pagination/ListPagination.js +2 -2
- package/lib-es/components/List/helpers/build-az-url.js +2 -2
- package/lib-es/components/List/helpers/build-pagination-url.js +2 -2
- package/lib-es/components/List/helpers/get-list-query.js +5 -2
- package/lib-es/components/List/helpers/get-list-query.js.map +1 -1
- package/lib-es/components/List/helpers/get-sort-props.js +5 -1
- package/lib-es/components/List/helpers/get-sort-props.js.map +1 -1
- package/lib-es/components/SearchFilter/components/Range.js +2 -2
- package/lib-es/components/SearchFilter/searchFilterReducer.js +2 -2
- package/lib-es/components/SearchFilterSort/helpers/update-sort.js +2 -2
- package/lib-es/components/TextBlock/index.js +2 -2
- package/lib-es/components/Video/Video.js +2 -2
- package/lib-es/components/Video/providers/JWPlayer/JWPlayerProvider.js +2 -2
- package/lib-es/constants/index.js +2 -31
- package/lib-es/constants/index.js.map +1 -1
- package/lib-es/helpers/append-images.js +2 -2
- package/lib-es/helpers/build-az-filter.js +3 -2
- package/lib-es/helpers/build-az-filter.js.map +1 -1
- package/lib-es/helpers/build-raw-query-base.js +2 -2
- package/lib-es/helpers/build-raw-query.js +26 -8
- package/lib-es/helpers/build-raw-query.js.map +1 -1
- package/lib-es/helpers/build-sort-values.js +34 -0
- package/lib-es/helpers/build-sort-values.js.map +1 -0
- package/lib-es/helpers/get-banner-data.js +2 -2
- package/lib-es/helpers/get-click-wrapper-options.js +2 -2
- package/lib-es/helpers/get-entities-with-banner.js +2 -2
- package/lib-es/helpers/get-extra-az-bits.js +48 -2
- package/lib-es/helpers/get-extra-az-bits.js.map +1 -1
- package/lib-es/helpers/get-generic-props.js +2 -2
- package/lib-es/helpers/get-generic-render-variables.js +24 -28
- package/lib-es/helpers/get-generic-render-variables.js.map +1 -1
- package/lib-es/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js +2 -2
- package/lib-es/helpers/process-data-summary-value.js +2 -2
- package/lib-es/helpers/remove-unwanted-characters.js +2 -2
- package/lib-es/helpers/render-children.js +2 -2
- package/lib-es/helpers/split-children.js +2 -2
- package/lib-es/helpers/update-childrens-parent.js +2 -2
- package/lib-es/hooks/helpers/append-gtm-classname.js +2 -2
- package/lib-es/hooks/helpers/buildPBComponents.js +2 -2
- package/lib-es/hooks/helpers/get-lightbox-images.js +2 -2
- package/lib-es/hooks/helpers/inject-element-banners.js +2 -2
- package/lib-es/hooks/helpers/inject-textblock-banners.js +2 -2
- package/lib-es/utils/get-class-modifiers.js +2 -2
- package/package.json +10 -10
- package/src/components/Card/helpers/filter-query-setup.js +4 -5
- package/src/components/DataSummary/helpers/build-loop-props-content.js +3 -2
- package/src/components/DataSummary/helpers/get-link-to-published-content.js +4 -1
- package/src/components/List/ListBuilder.js +46 -55
- package/src/components/List/ListFactory.js +9 -7
- package/src/components/List/helpers/get-list-query.js +5 -2
- package/src/components/List/helpers/get-sort-props.js +9 -1
- package/src/constants/index.js +2 -32
- package/src/helpers/build-az-filter.js +3 -2
- package/src/helpers/build-raw-query.js +9 -7
- package/src/helpers/build-sort-values.js +32 -0
- package/src/helpers/get-extra-az-bits.js +40 -2
- package/src/helpers/get-generic-render-variables.js +20 -27
- package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +41 -0
- package/tests/unit/src/components/DataSummary/helpers/get-link-to-published-content.test.js +21 -0
- package/tests/unit/src/components/List/helpers/get-list-query.test.js +55 -0
- package/tests/unit/src/components/List/helpers/get-sort-props.test.js +18 -0
- package/tests/unit/src/components/PlaceholderIcon/__snapshots__/index.test.js.snap +72 -0
- package/tests/unit/src/components/PlaceholderIcon/index.test.js +20 -0
- package/tests/unit/src/constants/__snapshots__/index.test.js.snap +3 -0
- package/tests/unit/src/constants/index.test.js +7 -0
- package/tests/unit/src/helpers/__snapshots__/get-extra-az-bits.test.js.snap +137 -0
- package/tests/unit/src/helpers/build-az-query.test.js +4 -3
- package/tests/unit/src/helpers/build-raw-query.test.js +82 -58
- package/tests/unit/src/helpers/build-sort-values.test.js +34 -0
- package/tests/unit/src/helpers/get-extra-az-bits.test.js +36 -6
- package/tests/unit/src/helpers/get-generic-render-variables.test.js +50 -53
|
@@ -43,17 +43,17 @@ describe('build raw query', () => {
|
|
|
43
43
|
id,
|
|
44
44
|
itemsToDisplay
|
|
45
45
|
} = MOCKED_ARGS;
|
|
46
|
-
const rawQuery = buildRawQuery(
|
|
46
|
+
const rawQuery = buildRawQuery({
|
|
47
47
|
docType,
|
|
48
48
|
operator,
|
|
49
|
-
{
|
|
49
|
+
searchValues: {
|
|
50
50
|
searchValuesText,
|
|
51
51
|
searchValuesCheckboxSelectRange,
|
|
52
52
|
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
53
53
|
},
|
|
54
54
|
filterData,
|
|
55
55
|
id
|
|
56
|
-
);
|
|
56
|
+
});
|
|
57
57
|
|
|
58
58
|
it('should always return an object', () => {
|
|
59
59
|
expect(typeof rawQuery).toBe('object');
|
|
@@ -64,65 +64,65 @@ describe('build raw query', () => {
|
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
it('should return an object with only checkbox & select search values', () => {
|
|
67
|
-
const rawQueryCheckboxSelect = buildRawQuery(
|
|
67
|
+
const rawQueryCheckboxSelect = buildRawQuery({
|
|
68
68
|
docType,
|
|
69
69
|
operator,
|
|
70
|
-
{
|
|
70
|
+
searchValues: {
|
|
71
71
|
searchValuesText: SEARCH_VALUES_TEXT_EMPTY,
|
|
72
72
|
searchValuesCheckboxSelectRange: SEARCH_VALUES_CHECKBOX_SELECT,
|
|
73
73
|
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
74
74
|
},
|
|
75
75
|
filterData,
|
|
76
76
|
id
|
|
77
|
-
);
|
|
77
|
+
});
|
|
78
78
|
|
|
79
79
|
expect(rawQueryCheckboxSelect).toEqual(RAW_QUERY_CHECKBOX_SELECT);
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
it('should return an object with only checkbox & select search values when checkbox has OR operator', () => {
|
|
83
|
-
const rawQueryCheckboxSelect = buildRawQuery(
|
|
83
|
+
const rawQueryCheckboxSelect = buildRawQuery({
|
|
84
84
|
docType,
|
|
85
85
|
operator,
|
|
86
|
-
{
|
|
86
|
+
searchValues: {
|
|
87
87
|
searchValuesText: SEARCH_VALUES_TEXT_EMPTY,
|
|
88
88
|
searchValuesCheckboxSelectRange: SEARCH_VALUES_CHECKBOX_SELECT,
|
|
89
89
|
searchValuesCheckboxOr
|
|
90
90
|
},
|
|
91
91
|
filterData,
|
|
92
92
|
id
|
|
93
|
-
);
|
|
93
|
+
});
|
|
94
94
|
|
|
95
95
|
expect(rawQueryCheckboxSelect).toEqual(RAW_QUERY_CHECKBOX_SELECT_CHECKBOX_HAS_OR_OPERATOR);
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
it('should return an object with all search values (checkbox, select, text) - and same operator', () => {
|
|
99
|
-
const rawQueryCheckboxSelectTextSameOp = buildRawQuery(
|
|
99
|
+
const rawQueryCheckboxSelectTextSameOp = buildRawQuery({
|
|
100
100
|
docType,
|
|
101
|
-
AND_OPERATOR,
|
|
102
|
-
{
|
|
101
|
+
operator: AND_OPERATOR,
|
|
102
|
+
searchValues: {
|
|
103
103
|
searchValuesText: SEARCH_VALUES_TEXT,
|
|
104
104
|
searchValuesCheckboxSelectRange: SEARCH_VALUES_CHECKBOX_SELECT,
|
|
105
105
|
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
106
106
|
},
|
|
107
107
|
filterData,
|
|
108
108
|
id
|
|
109
|
-
);
|
|
109
|
+
});
|
|
110
110
|
|
|
111
111
|
expect(rawQueryCheckboxSelectTextSameOp).toEqual(RAW_QUERY_ALL_SEARCH_VALUE_SAME_OPERATOR);
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
it('should return an object with all search values (checkbox, select, text) - and different operator', () => {
|
|
115
|
-
const rawQueryCheckboxSelectTextDifferentOp = buildRawQuery(
|
|
115
|
+
const rawQueryCheckboxSelectTextDifferentOp = buildRawQuery({
|
|
116
116
|
docType,
|
|
117
117
|
operator,
|
|
118
|
-
{
|
|
118
|
+
searchValues: {
|
|
119
119
|
searchValuesText: SEARCH_VALUES_TEXT,
|
|
120
120
|
searchValuesCheckboxSelectRange: SEARCH_VALUES_CHECKBOX_SELECT,
|
|
121
121
|
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
122
122
|
},
|
|
123
123
|
filterData,
|
|
124
124
|
id
|
|
125
|
-
);
|
|
125
|
+
});
|
|
126
126
|
|
|
127
127
|
expect(rawQueryCheckboxSelectTextDifferentOp).toEqual(
|
|
128
128
|
RAW_QUERY_ALL_SEARCH_VALUE_DIFFERENT_OPERATOR
|
|
@@ -130,17 +130,17 @@ describe('build raw query', () => {
|
|
|
130
130
|
});
|
|
131
131
|
|
|
132
132
|
it('should return an object with all search values (checkbox, select, text) - same operator for text and checkbox with OR operator', () => {
|
|
133
|
-
const rawQueryCheckboxSelectTextSameOp = buildRawQuery(
|
|
133
|
+
const rawQueryCheckboxSelectTextSameOp = buildRawQuery({
|
|
134
134
|
docType,
|
|
135
|
-
AND_OPERATOR,
|
|
136
|
-
{
|
|
135
|
+
operator: AND_OPERATOR,
|
|
136
|
+
searchValues: {
|
|
137
137
|
searchValuesText: SEARCH_VALUES_TEXT,
|
|
138
138
|
searchValuesCheckboxSelectRange: SEARCH_VALUES_CHECKBOX_SELECT,
|
|
139
139
|
searchValuesCheckboxOr
|
|
140
140
|
},
|
|
141
141
|
filterData,
|
|
142
142
|
id
|
|
143
|
-
);
|
|
143
|
+
});
|
|
144
144
|
|
|
145
145
|
expect(rawQueryCheckboxSelectTextSameOp).toEqual(
|
|
146
146
|
RAW_QUERY_ALL_SEARCH_VALUE_SAME_OPERATOR_TEXT_CHECKBOX_HAS_OR_OPERATOR
|
|
@@ -148,17 +148,17 @@ describe('build raw query', () => {
|
|
|
148
148
|
});
|
|
149
149
|
|
|
150
150
|
it('should return an object with all search values (checkbox, select, text) - and different operator for text and checkbox with OR operator', () => {
|
|
151
|
-
const rawQueryCheckboxSelectTextDifferentOp = buildRawQuery(
|
|
151
|
+
const rawQueryCheckboxSelectTextDifferentOp = buildRawQuery({
|
|
152
152
|
docType,
|
|
153
153
|
operator,
|
|
154
|
-
{
|
|
154
|
+
searchValues: {
|
|
155
155
|
searchValuesText: SEARCH_VALUES_TEXT,
|
|
156
156
|
searchValuesCheckboxSelectRange: SEARCH_VALUES_CHECKBOX_SELECT,
|
|
157
157
|
searchValuesCheckboxOr
|
|
158
158
|
},
|
|
159
159
|
filterData,
|
|
160
160
|
id
|
|
161
|
-
);
|
|
161
|
+
});
|
|
162
162
|
|
|
163
163
|
expect(rawQueryCheckboxSelectTextDifferentOp).toEqual(
|
|
164
164
|
RAW_QUERY_ALL_SEARCH_VALUE_DIFFERENT_OPERATOR_TEXT_CHECKBOX_HAS_OR_OPERATOR
|
|
@@ -166,15 +166,15 @@ describe('build raw query', () => {
|
|
|
166
166
|
});
|
|
167
167
|
|
|
168
168
|
it('should return an object with featured & sponsored filter set on list', () => {
|
|
169
|
-
const rawQueryMoreCheckboxFilters = buildRawQuery(
|
|
169
|
+
const rawQueryMoreCheckboxFilters = buildRawQuery({
|
|
170
170
|
docType,
|
|
171
171
|
operator,
|
|
172
|
-
{
|
|
172
|
+
searchValues: {
|
|
173
173
|
searchValuesText,
|
|
174
174
|
searchValuesCheckboxSelectRange,
|
|
175
175
|
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
176
176
|
},
|
|
177
|
-
{
|
|
177
|
+
filterData: {
|
|
178
178
|
filterValues: { checkboxFilters: ['featured', 'sponsored'], listFilterValues: {} },
|
|
179
179
|
filterOperator: AND,
|
|
180
180
|
relations: [],
|
|
@@ -182,42 +182,42 @@ describe('build raw query', () => {
|
|
|
182
182
|
azFilter: 'x'
|
|
183
183
|
},
|
|
184
184
|
id
|
|
185
|
-
);
|
|
185
|
+
});
|
|
186
186
|
|
|
187
187
|
expect(rawQueryMoreCheckboxFilters).toEqual(RAW_QUERY_CHECKBOX_FILTERS);
|
|
188
188
|
});
|
|
189
189
|
|
|
190
190
|
it('should return an object with just one checkbox filter set on list', () => {
|
|
191
|
-
const rawQueryOneCheckboxFilter = buildRawQuery(
|
|
191
|
+
const rawQueryOneCheckboxFilter = buildRawQuery({
|
|
192
192
|
docType,
|
|
193
193
|
operator,
|
|
194
|
-
{
|
|
194
|
+
searchValues: {
|
|
195
195
|
searchValuesText,
|
|
196
196
|
searchValuesCheckboxSelectRange,
|
|
197
197
|
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
198
198
|
},
|
|
199
|
-
{
|
|
199
|
+
filterData: {
|
|
200
200
|
filterValues: { checkboxFilters: ['sponsored'], listFilterValues: {} },
|
|
201
201
|
filterOperator: AND,
|
|
202
202
|
relations: [],
|
|
203
203
|
stringProps: []
|
|
204
204
|
},
|
|
205
205
|
id
|
|
206
|
-
);
|
|
206
|
+
});
|
|
207
207
|
|
|
208
208
|
expect(rawQueryOneCheckboxFilter).toEqual(RAW_QUERY_ONE_CHECKBOX_FILTERS);
|
|
209
209
|
});
|
|
210
210
|
|
|
211
211
|
it('should return an object with just one checkbox filter set on list & other filter values', () => {
|
|
212
|
-
const rawQueryOneCheckboxFilterMoreValues = buildRawQuery(
|
|
212
|
+
const rawQueryOneCheckboxFilterMoreValues = buildRawQuery({
|
|
213
213
|
docType,
|
|
214
214
|
operator,
|
|
215
|
-
{
|
|
215
|
+
searchValues: {
|
|
216
216
|
searchValuesText,
|
|
217
217
|
searchValuesCheckboxSelectRange,
|
|
218
218
|
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
219
219
|
},
|
|
220
|
-
{
|
|
220
|
+
filterData: {
|
|
221
221
|
filterValues: {
|
|
222
222
|
checkboxFilters: ['sponsored'],
|
|
223
223
|
listFilterValues: {
|
|
@@ -230,7 +230,7 @@ describe('build raw query', () => {
|
|
|
230
230
|
stringProps: ['name', 'category.name']
|
|
231
231
|
},
|
|
232
232
|
id
|
|
233
|
-
);
|
|
233
|
+
});
|
|
234
234
|
|
|
235
235
|
expect(rawQueryOneCheckboxFilterMoreValues).toEqual(
|
|
236
236
|
RAW_QUERY_ONE_CHECKBOX_FILTERS_AND_OTHER_FILTERS
|
|
@@ -238,15 +238,15 @@ describe('build raw query', () => {
|
|
|
238
238
|
});
|
|
239
239
|
|
|
240
240
|
it('should return an object with just one checkbox filter set on list & other filter values plus itemsToDIsplayIds', () => {
|
|
241
|
-
const rawQueryOneCheckboxFilterMoreItemsToDisplayValues = buildRawQuery(
|
|
241
|
+
const rawQueryOneCheckboxFilterMoreItemsToDisplayValues = buildRawQuery({
|
|
242
242
|
docType,
|
|
243
243
|
operator,
|
|
244
|
-
{
|
|
244
|
+
searchValues: {
|
|
245
245
|
searchValuesText,
|
|
246
246
|
searchValuesCheckboxSelectRange,
|
|
247
247
|
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
248
248
|
},
|
|
249
|
-
{
|
|
249
|
+
filterData: {
|
|
250
250
|
filterValues: {
|
|
251
251
|
checkboxFilters: ['sponsored'],
|
|
252
252
|
listFilterValues: {
|
|
@@ -261,21 +261,21 @@ describe('build raw query', () => {
|
|
|
261
261
|
},
|
|
262
262
|
id,
|
|
263
263
|
itemsToDisplay
|
|
264
|
-
);
|
|
264
|
+
});
|
|
265
265
|
|
|
266
266
|
expect(rawQueryOneCheckboxFilterMoreItemsToDisplayValues).toEqual(RAW_QUERY_ITEMS_TO_DISPLAY);
|
|
267
267
|
});
|
|
268
268
|
|
|
269
269
|
it('should return an object with just one checkbox filter set on list & other filter values when the filter operator is OR', () => {
|
|
270
|
-
const rawQueryOneCheckboxFilterMoreValues = buildRawQuery(
|
|
270
|
+
const rawQueryOneCheckboxFilterMoreValues = buildRawQuery({
|
|
271
271
|
docType,
|
|
272
272
|
operator,
|
|
273
|
-
{
|
|
273
|
+
searchValues: {
|
|
274
274
|
searchValuesText,
|
|
275
275
|
searchValuesCheckboxSelectRange,
|
|
276
276
|
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
277
277
|
},
|
|
278
|
-
{
|
|
278
|
+
filterData: {
|
|
279
279
|
filterValues: {
|
|
280
280
|
checkboxFilters: ['featured'],
|
|
281
281
|
listFilterValues: { 'authors.firstname': ['John', 'Paul'], price: ['33'] }
|
|
@@ -285,7 +285,7 @@ describe('build raw query', () => {
|
|
|
285
285
|
stringProps: ['author.firstname']
|
|
286
286
|
},
|
|
287
287
|
id
|
|
288
|
-
);
|
|
288
|
+
});
|
|
289
289
|
|
|
290
290
|
expect(rawQueryOneCheckboxFilterMoreValues).toEqual(
|
|
291
291
|
RAW_QUERY_ONE_CHECKBOX_FILTERS_AND_OTHER_FILTERS_OR_OPERATOR
|
|
@@ -293,15 +293,15 @@ describe('build raw query', () => {
|
|
|
293
293
|
});
|
|
294
294
|
|
|
295
295
|
it('should return an object with just one checkbox filter set on list & other filter values when the filter operator is OR plus itemsToDIsplayIds', () => {
|
|
296
|
-
const rawQueryOneCheckboxFilterMoreItemsToDisplayValues = buildRawQuery(
|
|
296
|
+
const rawQueryOneCheckboxFilterMoreItemsToDisplayValues = buildRawQuery({
|
|
297
297
|
docType,
|
|
298
298
|
operator,
|
|
299
|
-
{
|
|
299
|
+
searchValues: {
|
|
300
300
|
searchValuesText,
|
|
301
301
|
searchValuesCheckboxSelectRange,
|
|
302
302
|
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
303
303
|
},
|
|
304
|
-
{
|
|
304
|
+
filterData: {
|
|
305
305
|
filterValues: {
|
|
306
306
|
checkboxFilters: ['sponsored'],
|
|
307
307
|
listFilterValues: { metaTitle: ['meta', 'more-meta'], slug: ['slug-link'] }
|
|
@@ -312,7 +312,7 @@ describe('build raw query', () => {
|
|
|
312
312
|
},
|
|
313
313
|
id,
|
|
314
314
|
itemsToDisplay
|
|
315
|
-
);
|
|
315
|
+
});
|
|
316
316
|
|
|
317
317
|
expect(rawQueryOneCheckboxFilterMoreItemsToDisplayValues).toEqual(
|
|
318
318
|
RAW_QUERY_OR_OPERATOR_ITEMS_TO_DISPLAY
|
|
@@ -320,15 +320,15 @@ describe('build raw query', () => {
|
|
|
320
320
|
});
|
|
321
321
|
|
|
322
322
|
it('should return corresponding query when there are items to display and should apply sort is passed as true', () => {
|
|
323
|
-
const rawQueryWithShouldApplySort = buildRawQuery(
|
|
323
|
+
const rawQueryWithShouldApplySort = buildRawQuery({
|
|
324
324
|
docType,
|
|
325
325
|
operator,
|
|
326
|
-
{
|
|
326
|
+
searchValues: {
|
|
327
327
|
searchValuesText,
|
|
328
328
|
searchValuesCheckboxSelectRange,
|
|
329
329
|
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
330
330
|
},
|
|
331
|
-
{
|
|
331
|
+
filterData: {
|
|
332
332
|
filterValues: {
|
|
333
333
|
checkboxFilters: ['sponsored'],
|
|
334
334
|
listFilterValues: { url: ['/url', '/alternative-url'], date: ['29-03-2020'] }
|
|
@@ -339,28 +339,52 @@ describe('build raw query', () => {
|
|
|
339
339
|
},
|
|
340
340
|
id,
|
|
341
341
|
itemsToDisplay,
|
|
342
|
-
true
|
|
343
|
-
);
|
|
342
|
+
shouldApplySort: true
|
|
343
|
+
});
|
|
344
344
|
|
|
345
345
|
expect(rawQueryWithShouldApplySort).toEqual(RAW_QUERY_WITH_SHOULD_APPLY_SORT);
|
|
346
346
|
});
|
|
347
347
|
|
|
348
348
|
it('should return query with aggs if requested', () => {
|
|
349
|
-
const queryWithAggs = buildRawQuery(
|
|
349
|
+
const queryWithAggs = buildRawQuery({
|
|
350
350
|
docType,
|
|
351
351
|
operator,
|
|
352
|
-
{
|
|
352
|
+
searchValues: {
|
|
353
353
|
searchValuesText,
|
|
354
354
|
searchValuesCheckboxSelectRange,
|
|
355
355
|
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
356
356
|
},
|
|
357
357
|
filterData,
|
|
358
358
|
id,
|
|
359
|
-
[],
|
|
360
|
-
true,
|
|
361
|
-
{ shouldReturnAggs: true, isAZ: true }
|
|
362
|
-
);
|
|
359
|
+
itemsToDisplay: [],
|
|
360
|
+
shouldApplySort: true,
|
|
361
|
+
azOptions: { shouldReturnAggs: true, isAZ: true }
|
|
362
|
+
});
|
|
363
363
|
|
|
364
364
|
expect(queryWithAggs).toEqual(RAW_QUERY_WITH_AGGS);
|
|
365
365
|
});
|
|
366
|
+
|
|
367
|
+
it('should return query with aggs if requested using custom az param', () => {
|
|
368
|
+
const customProperty = 'lastname';
|
|
369
|
+
const queryWithAggs = buildRawQuery({
|
|
370
|
+
docType,
|
|
371
|
+
operator,
|
|
372
|
+
searchValues: {
|
|
373
|
+
searchValuesText,
|
|
374
|
+
searchValuesCheckboxSelectRange,
|
|
375
|
+
searchValuesCheckboxOr: searchValuesCheckboxOrEmpty
|
|
376
|
+
},
|
|
377
|
+
filterData,
|
|
378
|
+
id,
|
|
379
|
+
itemsToDisplay: [],
|
|
380
|
+
shouldApplySort: true,
|
|
381
|
+
azOptions: {
|
|
382
|
+
shouldReturnAggs: true,
|
|
383
|
+
isAZ: true,
|
|
384
|
+
sortProperties: [{ propsToDisplay: [customProperty] }]
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
expect(JSON.stringify(queryWithAggs)).toContain(`${customProperty}.keyword`);
|
|
389
|
+
});
|
|
366
390
|
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
2
|
+
import buildSortValues from '../../../../src/helpers/build-sort-values';
|
|
3
|
+
|
|
4
|
+
describe('buildSortValues helper function', () => {
|
|
5
|
+
it('should return an object with empty sort array if no sortFilters are passed', () => {
|
|
6
|
+
const noSort = buildSortValues();
|
|
7
|
+
const emptySortFilters = buildSortValues([]);
|
|
8
|
+
expect(noSort).toEqual({ sort: [] });
|
|
9
|
+
expect(emptySortFilters).toEqual({ sort: [] });
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should return null if no sortFilters are passed and useSortObject is true', () => {
|
|
13
|
+
const noSortUseSortObject = buildSortValues(null, [], [], true);
|
|
14
|
+
const emptySortFiltersUseSortObject = buildSortValues([], [], [], true);
|
|
15
|
+
expect(noSortUseSortObject).toEqual(null);
|
|
16
|
+
expect(emptySortFiltersUseSortObject).toEqual(null);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should return sort object if useSortObject is true and sortFilters match', () => {
|
|
20
|
+
const withUseSortObject = buildSortValues(
|
|
21
|
+
[
|
|
22
|
+
{
|
|
23
|
+
propsToDisplay: ['slug'],
|
|
24
|
+
sort: 'ASC',
|
|
25
|
+
label: ''
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
[],
|
|
29
|
+
['name', 'slug', 'metaTitle'],
|
|
30
|
+
true
|
|
31
|
+
);
|
|
32
|
+
expect(withUseSortObject).toEqual({ 'slug.keyword': 'asc' });
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -1,21 +1,51 @@
|
|
|
1
|
+
import { AZ_DEFAULT_PROP } from '../../../../src/constants';
|
|
1
2
|
import getExtraAzBits from '../../../../src/helpers/get-extra-az-bits';
|
|
2
|
-
import { AZ_AGGS, ALL_AZ_SORT } from '../../../../src/constants';
|
|
3
3
|
|
|
4
4
|
describe('getExtraAzBits helper function', () => {
|
|
5
|
+
// shouldReturnAggs, isAZ, azSortProperty, azFilter
|
|
6
|
+
const customProperty = 'lastname';
|
|
7
|
+
|
|
5
8
|
it('should return empty object if isAz is false', () => {
|
|
6
|
-
const noExtraBits = getExtraAzBits(false, false);
|
|
9
|
+
const noExtraBits = getExtraAzBits({ shouldReturnAggs: false, isAZ: false });
|
|
7
10
|
const noExtraBits2 = getExtraAzBits(false, true, 'a');
|
|
8
11
|
expect(noExtraBits).toEqual({});
|
|
9
12
|
expect(noExtraBits2).toEqual({});
|
|
10
13
|
});
|
|
11
14
|
|
|
12
15
|
it('should return AZ_AGGS if shouldReturnAggs and isAz is true', () => {
|
|
13
|
-
const withAggs = getExtraAzBits(true, true);
|
|
14
|
-
|
|
16
|
+
const withAggs = getExtraAzBits({ shouldReturnAggs: true, isAZ: true });
|
|
17
|
+
propertyCheck(withAggs);
|
|
18
|
+
expect(withAggs).toMatchSnapshot();
|
|
15
19
|
});
|
|
16
20
|
|
|
17
21
|
it('should return ALL_AZ_SORT if shouldReturnAggs is false and is Az and no Az filter is passed', () => {
|
|
18
|
-
const withAggs = getExtraAzBits(false, true, '');
|
|
19
|
-
|
|
22
|
+
const withAggs = getExtraAzBits({ shouldReturnAggs: false, isAZ: true, azFilter: '' });
|
|
23
|
+
propertyCheck(withAggs);
|
|
24
|
+
expect(withAggs).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should return AZ_AGGS if shouldReturnAggs and isAz is true with custom property', () => {
|
|
28
|
+
const withAggs = getExtraAzBits({
|
|
29
|
+
shouldReturnAggs: true,
|
|
30
|
+
isAZ: true,
|
|
31
|
+
azSortProperty: customProperty
|
|
32
|
+
});
|
|
33
|
+
propertyCheck(withAggs, customProperty);
|
|
34
|
+
expect(withAggs).toMatchSnapshot();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should return ALL_AZ_SORT if shouldReturnAggs is false and is Az and no Az filter is passed with custom property', () => {
|
|
38
|
+
const withAggs = getExtraAzBits({
|
|
39
|
+
shouldReturnAggs: false,
|
|
40
|
+
isAZ: true,
|
|
41
|
+
azFilter: '',
|
|
42
|
+
azSortProperty: customProperty
|
|
43
|
+
});
|
|
44
|
+
propertyCheck(withAggs, customProperty);
|
|
45
|
+
expect(withAggs).toMatchSnapshot();
|
|
20
46
|
});
|
|
21
47
|
});
|
|
48
|
+
|
|
49
|
+
function propertyCheck(result, property = AZ_DEFAULT_PROP) {
|
|
50
|
+
expect(JSON.stringify(result)).toContain(`${property}.keyword`);
|
|
51
|
+
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import '@testing-library/jest-dom/extend-expect';
|
|
2
2
|
import getGenericRenderVariables from '../../../../src/helpers/get-generic-render-variables';
|
|
3
3
|
|
|
4
|
-
const IS_TEXT_SEARCH_FILTER_APPLIED_TRUE = true;
|
|
5
|
-
const IS_TEXT_SEARCH_FILTER_APPLIED_FALSE = false;
|
|
6
4
|
const RAW_QUERY_STRINGIFIED = '{}';
|
|
7
5
|
const SORT_VALUE = 'updated:desc';
|
|
8
6
|
const STRING_PROPS_EMPTY = [];
|
|
@@ -18,88 +16,87 @@ const mockedProps = overrides => ({
|
|
|
18
16
|
|
|
19
17
|
describe('get card/list render variables', () => {
|
|
20
18
|
it('should always return an object', () => {
|
|
21
|
-
const variables = getGenericRenderVariables();
|
|
22
|
-
const variablesWithProps = getGenericRenderVariables(
|
|
19
|
+
const variables = getGenericRenderVariables({});
|
|
20
|
+
const variablesWithProps = getGenericRenderVariables({
|
|
21
|
+
relations: [],
|
|
22
|
+
filterProps: mockedProps(),
|
|
23
|
+
stringProps: STRING_PROPS_EMPTY
|
|
24
|
+
});
|
|
23
25
|
|
|
24
26
|
expect(typeof variables).toBe('object');
|
|
25
27
|
expect(typeof variablesWithProps).toBe('object');
|
|
26
28
|
});
|
|
27
29
|
|
|
28
30
|
it('should return an object with correct data', () => {
|
|
29
|
-
const { limit, sort, offset } = getGenericRenderVariables(
|
|
30
|
-
[],
|
|
31
|
-
mockedProps(),
|
|
32
|
-
STRING_PROPS_EMPTY
|
|
33
|
-
);
|
|
31
|
+
const { limit, sort, offset } = getGenericRenderVariables({
|
|
32
|
+
relations: [],
|
|
33
|
+
filterProps: mockedProps(),
|
|
34
|
+
stringProps: STRING_PROPS_EMPTY
|
|
35
|
+
});
|
|
34
36
|
|
|
35
37
|
expect(limit).toEqual(50);
|
|
36
38
|
expect(offset).toEqual(2);
|
|
37
39
|
expect(sort).toEqual(SORT_VALUE);
|
|
38
40
|
});
|
|
39
41
|
|
|
40
|
-
it('should return an object with sort being undefined when text-search filter applied', () => {
|
|
41
|
-
const { sort } = getGenericRenderVariables(
|
|
42
|
-
[],
|
|
43
|
-
mockedProps(),
|
|
44
|
-
STRING_PROPS_EMPTY,
|
|
45
|
-
RAW_QUERY_STRINGIFIED,
|
|
46
|
-
IS_TEXT_SEARCH_FILTER_APPLIED_TRUE
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
expect(sort).toBeFalsy();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
42
|
it('should return an object with correct sort when text-search filter not applied', () => {
|
|
53
|
-
const { sort } = getGenericRenderVariables(
|
|
54
|
-
[],
|
|
55
|
-
mockedProps(),
|
|
56
|
-
STRING_PROPS_EMPTY,
|
|
57
|
-
RAW_QUERY_STRINGIFIED,
|
|
58
|
-
|
|
59
|
-
);
|
|
43
|
+
const { sort } = getGenericRenderVariables({
|
|
44
|
+
relations: [],
|
|
45
|
+
filterProps: mockedProps(),
|
|
46
|
+
stringProps: STRING_PROPS_EMPTY,
|
|
47
|
+
rawQuery: RAW_QUERY_STRINGIFIED,
|
|
48
|
+
isTextSearchFilterApplied: false
|
|
49
|
+
});
|
|
60
50
|
|
|
61
51
|
expect(sort).toEqual(SORT_VALUE);
|
|
62
52
|
});
|
|
63
53
|
|
|
64
54
|
it('should return an object with correct data when no arguments passed to function', () => {
|
|
65
|
-
const { sort, offset } = getGenericRenderVariables();
|
|
66
|
-
|
|
55
|
+
const { sort, offset } = getGenericRenderVariables({});
|
|
67
56
|
expect(sort).toBeFalsy();
|
|
68
57
|
expect(offset).toEqual(0);
|
|
69
58
|
});
|
|
70
59
|
|
|
71
60
|
it('should return an object with correct data when no sortby is passed', () => {
|
|
72
|
-
const { sort, offset } = getGenericRenderVariables(mockedProps({ sortby: [] }));
|
|
61
|
+
const { sort, offset } = getGenericRenderVariables({ relations: mockedProps({ sortby: [] }) });
|
|
73
62
|
|
|
74
63
|
expect(sort).toBeFalsy();
|
|
75
64
|
expect(offset).toEqual(0);
|
|
76
65
|
});
|
|
77
66
|
|
|
78
67
|
it('should return correct sort data when we pass an array', () => {
|
|
79
|
-
const { sort } = getGenericRenderVariables(
|
|
80
|
-
[],
|
|
81
|
-
mockedProps({ sortby: ['length'] }),
|
|
82
|
-
STRING_PROPS_EMPTY
|
|
83
|
-
);
|
|
68
|
+
const { sort } = getGenericRenderVariables({
|
|
69
|
+
relations: [],
|
|
70
|
+
filterProps: mockedProps({ sortby: ['length'] }),
|
|
71
|
+
stringProps: STRING_PROPS_EMPTY
|
|
72
|
+
});
|
|
84
73
|
expect(sort).toEqual('length:desc');
|
|
85
74
|
});
|
|
86
75
|
|
|
87
76
|
it('should return correct sort data when when there is a prop that is of type string', () => {
|
|
88
|
-
const { sort } = getGenericRenderVariables(
|
|
77
|
+
const { sort } = getGenericRenderVariables({
|
|
78
|
+
relations: [],
|
|
79
|
+
filterProps: mockedProps({ sortby: 'name' }),
|
|
80
|
+
stringProps: STRING_PROPS
|
|
81
|
+
});
|
|
89
82
|
expect(sort).toEqual('name.keyword:desc');
|
|
90
83
|
});
|
|
91
84
|
|
|
92
85
|
it('should return correct sort data sortby is an array', () => {
|
|
93
|
-
const { sort } = getGenericRenderVariables(
|
|
86
|
+
const { sort } = getGenericRenderVariables({
|
|
87
|
+
relations: [],
|
|
88
|
+
filterProps: mockedProps({ sortby: ['name'] }),
|
|
89
|
+
stringProps: STRING_PROPS
|
|
90
|
+
});
|
|
94
91
|
expect(sort).toEqual('name.keyword:desc');
|
|
95
92
|
});
|
|
96
93
|
|
|
97
94
|
it("should return correct sort data when when there is a prop that is of type string and it's also a relation prop", () => {
|
|
98
|
-
const { sort } = getGenericRenderVariables(
|
|
99
|
-
[{ localField: 'entity', entityIdentifier: 'entity' }],
|
|
100
|
-
mockedProps({ sortby: 'entity.name', sort: 'ASC' }),
|
|
101
|
-
['entity.name']
|
|
102
|
-
);
|
|
95
|
+
const { sort } = getGenericRenderVariables({
|
|
96
|
+
relations: [{ localField: 'entity', entityIdentifier: 'entity' }],
|
|
97
|
+
filterProps: mockedProps({ sortby: 'entity.name', sort: 'ASC' }),
|
|
98
|
+
stringProps: ['entity.name']
|
|
99
|
+
});
|
|
103
100
|
|
|
104
101
|
expect(sort).toEqual('entity.name.keyword:asc');
|
|
105
102
|
});
|
|
@@ -107,21 +104,21 @@ describe('get card/list render variables', () => {
|
|
|
107
104
|
it("should return correct sort data when when there is a prop that is not of type string but it's a relation prop", () => {
|
|
108
105
|
const localField = 'entityField';
|
|
109
106
|
const sortby = `${localField}.length`;
|
|
110
|
-
const { sort } = getGenericRenderVariables(
|
|
111
|
-
[{ localField, entityIdentifier: 'entity' }],
|
|
112
|
-
mockedProps({ sortby, sort: 'ASC' }),
|
|
113
|
-
[]
|
|
114
|
-
);
|
|
107
|
+
const { sort } = getGenericRenderVariables({
|
|
108
|
+
relations: [{ localField, entityIdentifier: 'entity' }],
|
|
109
|
+
filterProps: mockedProps({ sortby, sort: 'ASC' }),
|
|
110
|
+
stringProps: []
|
|
111
|
+
});
|
|
115
112
|
|
|
116
113
|
expect(sort).toEqual(`${sortby}:asc`);
|
|
117
114
|
});
|
|
118
115
|
|
|
119
116
|
it('should return correct sort data when when there is a relation prop that is of type string but with updated value', () => {
|
|
120
|
-
const { sort } = getGenericRenderVariables(
|
|
121
|
-
[{ localField: 'tag', entityIdentifier: 'tags' }],
|
|
122
|
-
mockedProps({ sortby: 'tag.name', sort: 'ASC' }),
|
|
123
|
-
['tags.name']
|
|
124
|
-
);
|
|
117
|
+
const { sort } = getGenericRenderVariables({
|
|
118
|
+
relations: [{ localField: 'tag', entityIdentifier: 'tags' }],
|
|
119
|
+
filterProps: mockedProps({ sortby: 'tag.name', sort: 'ASC' }),
|
|
120
|
+
stringProps: ['tags.name']
|
|
121
|
+
});
|
|
125
122
|
|
|
126
123
|
expect(sort).toEqual('tag.name.keyword:asc');
|
|
127
124
|
});
|