cypress-ag-grid 2.0.3 → 3.0.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
|
@@ -151,20 +151,26 @@ function getColumnHeaderElement(agGridElement, columnName) {
|
|
|
151
151
|
* @returns
|
|
152
152
|
*/
|
|
153
153
|
export function sortColumnBy(agGridElement, columnName, sortDirection) {
|
|
154
|
+
if(sortDirection.toLowerCase() === "ascending"){
|
|
155
|
+
sortDirection = "asc"
|
|
156
|
+
}else if(sortDirection.toLowerCase() === "descending"){
|
|
157
|
+
sortDirection = "desc"
|
|
158
|
+
}
|
|
159
|
+
|
|
154
160
|
if (sortDirection === sort.ascending || sortDirection === sort.descending) {
|
|
155
161
|
return getColumnHeaderElement(agGridElement, columnName)
|
|
156
|
-
.parents(".ag-header-cell")
|
|
157
|
-
.invoke("attr", "
|
|
162
|
+
.parents(".ag-header-cell .ag-cell-label-container")
|
|
163
|
+
.invoke("attr", "class")
|
|
158
164
|
.then((value) => {
|
|
159
165
|
cy.log(`sort: ${sortDirection}`);
|
|
160
|
-
if
|
|
166
|
+
if(!value.includes(`ag-header-cell-sorted-${sortDirection}`)){
|
|
161
167
|
getColumnHeaderElement(agGridElement, columnName).click().wait(250);
|
|
162
168
|
sortColumnBy(agGridElement, columnName, sortDirection);
|
|
163
169
|
}
|
|
164
170
|
});
|
|
165
171
|
} else {
|
|
166
172
|
throw new Error(
|
|
167
|
-
"sortDirection must be either '
|
|
173
|
+
"sortDirection must be either 'asc' or 'desc'."
|
|
168
174
|
);
|
|
169
175
|
}
|
|
170
176
|
}
|
|
@@ -340,19 +346,9 @@ function populateSearchCriteria(
|
|
|
340
346
|
selectAllLocaleText = 'Select All'
|
|
341
347
|
) {
|
|
342
348
|
const options = {};
|
|
343
|
-
|
|
344
|
-
options.searchCriteria = {};
|
|
345
|
-
//@ts-ignore
|
|
346
|
-
options.searchCriteria.columnName = searchCriteria.columnName;
|
|
347
|
-
//@ts-ignore
|
|
348
|
-
options.searchCriteria.filterValue = searchCriteria.filterValue;
|
|
349
|
-
//@ts-ignore
|
|
350
|
-
options.searchCriteria.isMultiFilter = searchCriteria.isMultiFilter;
|
|
351
|
-
//@ts-ignore
|
|
349
|
+
options.searchCriteria = {...searchCriteria};
|
|
352
350
|
options.selectAllLocaleText = selectAllLocaleText;
|
|
353
|
-
//@ts-ignore
|
|
354
351
|
options.hasApplyButton = hasApplyButton;
|
|
355
|
-
//@ts-ignore
|
|
356
352
|
options.noMenuTabs = noMenuTabs;
|
|
357
353
|
return options;
|
|
358
354
|
}
|
package/src/agGrid/sort.enum.js
CHANGED