|
Lines 271-273
describe("Filters", () => {
Link Here
|
| 271 |
}); |
271 |
}); |
| 272 |
}); |
272 |
}); |
| 273 |
}); |
273 |
}); |
| 274 |
- |
274 |
|
|
|
275 |
describe("On single result", () => { |
| 276 |
const table_id = "memberresultst"; |
| 277 |
|
| 278 |
beforeEach(() => { |
| 279 |
cleanup(); |
| 280 |
cy.login(); |
| 281 |
cy.title().should("eq", "Koha staff interface"); |
| 282 |
cy.window().then(win => { |
| 283 |
win.localStorage.clear(); |
| 284 |
}); |
| 285 |
}); |
| 286 |
|
| 287 |
it("should redirect", () => { |
| 288 |
cy.task("insertSamplePatron").then(patron_objects => { |
| 289 |
let patron = patron_objects.patron; |
| 290 |
patron.library = patron_objects.library; |
| 291 |
cy.intercept("GET", "/api/v1/patrons*", { |
| 292 |
statusCode: 200, |
| 293 |
body: [patron], |
| 294 |
headers: { |
| 295 |
"X-Base-Total-Count": baseTotalCount, |
| 296 |
"X-Total-Count": "1", |
| 297 |
}, |
| 298 |
}).as("searchPatrons"); |
| 299 |
|
| 300 |
cy.visit("/cgi-bin/koha/mainpage.pl"); |
| 301 |
|
| 302 |
cy.get("#findborrower").type( |
| 303 |
`${patron.surname} ${patron.firstname}` |
| 304 |
); |
| 305 |
// Wait for auto complete |
| 306 |
cy.wait("@searchPatrons"); |
| 307 |
|
| 308 |
cy.get("#findborrower").type(`{enter}`); |
| 309 |
|
| 310 |
cy.title().should( |
| 311 |
"to.match", |
| 312 |
new RegExp(`^Checking out to.* ${patron.surname}`) |
| 313 |
); |
| 314 |
|
| 315 |
cy.location("pathname").should( |
| 316 |
"include", |
| 317 |
"/cgi-bin/koha/circ/circulation.pl" |
| 318 |
); |
| 319 |
cy.location("search").should( |
| 320 |
"include", |
| 321 |
`?borrowernumber=${patron.patron_id}` |
| 322 |
); |
| 323 |
}); |
| 324 |
}); |
| 325 |
}); |