cypress-ag-grid 3.2.1 → 3.2.2
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/app/data.json
CHANGED
|
@@ -18,5 +18,6 @@
|
|
|
18
18
|
{ "year": "1990", "make": "Ford", "model": "Taurus", "condition":"excellent","price": "900" },
|
|
19
19
|
{ "year": "2020", "make": "Hyundai", "model": "Elantra", "condition":"fair","price": "3000" },
|
|
20
20
|
{ "year": "2020", "make": "BMW", "model": "2002", "condition":"excellent","price": "88001" },
|
|
21
|
-
{ "year": "2023", "make": "Hyundai", "model": "Santa Fe", "condition":"excellent","price": "" }
|
|
21
|
+
{ "year": "2023", "make": "Hyundai", "model": "Santa Fe", "condition":"excellent","price": "" },
|
|
22
|
+
{ "year": "2020", "make": "Toyota", "model": "Celica", "condition": "fair", "price": "35000" }
|
|
22
23
|
]
|
|
@@ -38,6 +38,9 @@ const expectedPaginatedTableData = [
|
|
|
38
38
|
{ Year: "2020", Make: "BMW", Model: "2002", Condition: "excellent", Price: "88001" },
|
|
39
39
|
{ Year: "2023", Make: "Hyundai", Model: "Santa Fe", Condition: "excellent", Price: "" },
|
|
40
40
|
],
|
|
41
|
+
[
|
|
42
|
+
{ Year: "2020", Make: "Toyota", Model: "Celica", Condition: "fair", Price: "35000" },
|
|
43
|
+
]
|
|
41
44
|
];
|
|
42
45
|
|
|
43
46
|
describe("ag-grid get data scenarios", () => {
|
|
@@ -46,6 +49,31 @@ describe("ag-grid get data scenarios", () => {
|
|
|
46
49
|
cy.get(".ag-cell", { timeout: 10000 }).should("be.visible");
|
|
47
50
|
});
|
|
48
51
|
|
|
52
|
+
it("verify data when multiple rows are identical", ()=>{
|
|
53
|
+
|
|
54
|
+
const expectedTableData =
|
|
55
|
+
[
|
|
56
|
+
{ "Year": "2020", "Make": "Toyota", "Model": "Celica", "Condition": "fair", "Price": "35000" },
|
|
57
|
+
{ "Year": "2020", "Make": "Toyota", "Model": "Celica", "Condition": "poor", "Price": "5000" },
|
|
58
|
+
{ "Year": "2020", "Make": "Toyota", "Model": "Celica", "Condition": "fair", "Price": "35000" },
|
|
59
|
+
]
|
|
60
|
+
cy.get(agGridSelector).agGridColumnFilterCheckboxMenu({
|
|
61
|
+
searchCriteria: {
|
|
62
|
+
columnName: "Model",
|
|
63
|
+
filterValue: "Celica",
|
|
64
|
+
},
|
|
65
|
+
selectAllLocaleText: "Select All", // This is optional if you are using localText for ag grid
|
|
66
|
+
hasApplyButton: true,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
cy.get(agGridSelector)
|
|
70
|
+
.getAgGridData()
|
|
71
|
+
.then((actualTableData) => {
|
|
72
|
+
cy.agGridValidateRowsExactOrder(actualTableData, expectedTableData);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
})
|
|
76
|
+
|
|
49
77
|
it("verify paginated table data - any order - include all columns", () => {
|
|
50
78
|
cy.get(agGridSelector).agGridValidatePaginatedTable(
|
|
51
79
|
expectedPaginatedTableData
|
|
@@ -17,5 +17,6 @@
|
|
|
17
17
|
{ "Year": "2020", "Make": "Honda", "Model": "Accord", "Condition": "good", "Price": "34000" },
|
|
18
18
|
{ "Year": "1990", "Make": "Ford", "Model": "Taurus", "Condition": "excellent", "Price": "900" },
|
|
19
19
|
{ "Year": "2020", "Make": "Hyundai", "Model": "Elantra", "Condition": "fair", "Price": "3000" },
|
|
20
|
-
{ "Year": "2020", "Make": "BMW", "Model": "2002", "Condition": "excellent", "Price": "88001" }
|
|
20
|
+
{ "Year": "2020", "Make": "BMW", "Model": "2002", "Condition": "excellent", "Price": "88001" },
|
|
21
|
+
{ "Year": "2020", "Make": "Toyota", "Model": "Celica", "Condition": "fair", "Price": "35000" }
|
|
21
22
|
]
|
package/package.json
CHANGED
|
@@ -100,6 +100,14 @@ function _getAgGrid(agGridElement, options = {}, returnElements) {
|
|
|
100
100
|
return ele.length;
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
+
// Remove duplicate entries from allRows
|
|
104
|
+
// In some instances we see cell duplication for non-unique rows
|
|
105
|
+
allRows = allRows.map((row)=>{
|
|
106
|
+
return row.filter((cell, index)=>{
|
|
107
|
+
return row.indexOf(cell) === index;
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
|
|
103
111
|
if (!allRows.length) rows = [];
|
|
104
112
|
else {
|
|
105
113
|
rows = allRows
|