Lines 181-183
describe("Filters", () => {
Link Here
|
181 |
}); |
181 |
}); |
182 |
}); |
182 |
}); |
183 |
}); |
183 |
}); |
184 |
- |
184 |
|
|
|
185 |
describe("On single result", () => { |
186 |
const table_id = "memberresultst"; |
187 |
|
188 |
beforeEach(() => { |
189 |
cleanup(); |
190 |
cy.login(); |
191 |
cy.title().should("eq", "Koha staff interface"); |
192 |
cy.window().then(win => { |
193 |
win.localStorage.clear(); |
194 |
}); |
195 |
}); |
196 |
|
197 |
it("should redirect", () => { |
198 |
cy.task("insertSamplePatron").then(patron_objects => { |
199 |
let patron = patron_objects.patron; |
200 |
patron.library = patron_objects.library; |
201 |
cy.intercept("GET", "/api/v1/patrons*", { |
202 |
statusCode: 200, |
203 |
body: [patron], |
204 |
headers: { |
205 |
"X-Base-Total-Count": baseTotalCount, |
206 |
"X-Total-Count": "1", |
207 |
}, |
208 |
}).as("searchPatrons"); |
209 |
|
210 |
cy.visit("/cgi-bin/koha/mainpage.pl"); |
211 |
|
212 |
cy.get("#findborrower").type( |
213 |
`${patron.surname} ${patron.firstname}` |
214 |
); |
215 |
// Wait for auto complete |
216 |
cy.wait("@searchPatrons"); |
217 |
|
218 |
cy.get("#findborrower").type(`{enter}`); |
219 |
|
220 |
cy.title().should( |
221 |
"to.match", |
222 |
new RegExp(`^Checking out to.* ${patron.surname}`) |
223 |
); |
224 |
|
225 |
cy.location("pathname").should( |
226 |
"include", |
227 |
"/cgi-bin/koha/circ/circulation.pl" |
228 |
); |
229 |
cy.location("search").should( |
230 |
"include", |
231 |
`?borrowernumber=${patron.patron_id}` |
232 |
); |
233 |
}); |
234 |
}); |
235 |
}); |