|
Lines 159-183
describe("Filters", () => {
Link Here
|
| 159 |
`Showing 1 to ${RESTdefaultPageSize} of ${baseTotalCount} entries` |
159 |
`Showing 1 to ${RESTdefaultPageSize} of ${baseTotalCount} entries` |
| 160 |
); |
160 |
); |
| 161 |
|
161 |
|
| 162 |
cy.get(`#${table_id} thead tr`).should("have.length", 2); |
162 |
cy.get(`#${table_id}`).then($table => { |
| 163 |
|
163 |
const dt = $table.DataTable(); |
| 164 |
cy.get( |
164 |
const libraryCol = dt.column("library:name"); |
| 165 |
`#${table_id} thead tr th[data-filter='libraries'] select` |
165 |
const libraryVisibleIndex = libraryCol.index("visible"); |
| 166 |
).should("have.value", "^CPL$"); |
166 |
const categoryCol = dt.column("category:name"); |
| 167 |
// Lowercase see bug 32517 and related code in datatables.js |
167 |
const categoryVisibleIndex = categoryCol.index("visible"); |
| 168 |
cy.get( |
168 |
|
| 169 |
`#${table_id} thead tr th[data-filter='categories'] select` |
169 |
cy.get(`#${table_id} thead tr`).should("have.length", 2); |
| 170 |
).should("have.value", "^s$"); |
170 |
cy.get(`#${table_id} thead tr`) |
| 171 |
|
171 |
.eq(1) |
| 172 |
cy.get(`form.patron_search_form input.clear_search`).click(); |
172 |
.find("th") |
| 173 |
cy.get("form.patron_search_form input[type='submit']").click(); |
173 |
.eq(libraryVisibleIndex) |
| 174 |
cy.get( |
174 |
.find("select") |
| 175 |
`#${table_id} thead tr th[data-filter='libraries'] select` |
175 |
.should("have.value", "^CPL$"); |
| 176 |
).should("have.value", null); |
176 |
|
| 177 |
// Lowercase see bug 32517 and related code in datatables.js |
177 |
// Lowercase see bug 32517 and related code in datatables.js |
| 178 |
cy.get( |
178 |
cy.get(`#${table_id} thead tr`) |
| 179 |
`#${table_id} thead tr th[data-filter='categories'] select` |
179 |
.eq(1) |
| 180 |
).should("have.value", null); |
180 |
.find("th") |
|
|
181 |
.eq(categoryVisibleIndex) |
| 182 |
.find("select") |
| 183 |
.should("have.value", "^s$"); |
| 184 |
|
| 185 |
cy.get(`form.patron_search_form input.clear_search`).click(); |
| 186 |
cy.get("form.patron_search_form input[type='submit']").click(); |
| 187 |
cy.get(`#${table_id} thead tr`) |
| 188 |
.eq(1) |
| 189 |
.find("th") |
| 190 |
.eq(libraryVisibleIndex) |
| 191 |
.find("select") |
| 192 |
.should("have.value", null); |
| 193 |
// Lowercase see bug 32517 and related code in datatables.js |
| 194 |
cy.get(`#${table_id} thead tr`) |
| 195 |
.eq(1) |
| 196 |
.find("th") |
| 197 |
.eq(categoryVisibleIndex) |
| 198 |
.find("select") |
| 199 |
.should("have.value", null); |
| 200 |
}); |
| 181 |
}); |
201 |
}); |
| 182 |
}); |
202 |
}); |
| 183 |
|
203 |
|
|
Lines 257-265
describe("Filters", () => {
Link Here
|
| 257 |
|
277 |
|
| 258 |
cy.wait("@searchPatrons"); |
278 |
cy.wait("@searchPatrons"); |
| 259 |
|
279 |
|
| 260 |
cy.get( |
280 |
cy.get(`#${table_id}`).then($table => { |
| 261 |
`#${table_id} thead tr th[data-filter='libraries'] select` |
281 |
const dt = $table.DataTable(); |
| 262 |
).select("^CPL$"); |
282 |
const libraryCol = dt.column("library:name"); |
|
|
283 |
const libraryVisibleIndex = libraryCol.index("visible"); |
| 284 |
cy.get(`#${table_id} thead tr`) |
| 285 |
.eq(1) |
| 286 |
.find("th") |
| 287 |
.eq(libraryVisibleIndex) |
| 288 |
.find("select") |
| 289 |
.select("^CPL$"); |
| 290 |
}); |
| 263 |
|
291 |
|
| 264 |
cy.wait("@searchPatrons").then(interception => { |
292 |
cy.wait("@searchPatrons").then(interception => { |
| 265 |
const q = interception.request.query.q; |
293 |
const q = interception.request.query.q; |