|
Lines 38-49
describe("Package CRUD operations", () => {
Link Here
|
| 38 |
// GET package returns 500 |
38 |
// GET package returns 500 |
| 39 |
cy.intercept("GET", "/api/v1/erm/eholdings/local/packages*", { |
39 |
cy.intercept("GET", "/api/v1/erm/eholdings/local/packages*", { |
| 40 |
statusCode: 500, |
40 |
statusCode: 500, |
| 41 |
error: "Something went wrong", |
|
|
| 42 |
}); |
41 |
}); |
| 43 |
cy.visit("/cgi-bin/koha/erm/erm.pl"); |
42 |
cy.visit("/cgi-bin/koha/erm/erm.pl"); |
| 44 |
cy.get("#navmenulist").contains("Packages").click(); |
43 |
cy.get("#navmenulist").contains("Packages").click(); |
| 45 |
cy.get("main div[class='dialog alert']").contains( |
44 |
cy.get("main div[class='dialog alert']").contains( |
| 46 |
/Something went wrong/ |
45 |
"Something went wrong: Error: Internal Server Error" |
| 47 |
); |
46 |
); |
| 48 |
|
47 |
|
| 49 |
// GET packages returns empty list |
48 |
// GET packages returns empty list |
|
Lines 113-123
describe("Package CRUD operations", () => {
Link Here
|
| 113 |
// Submit the form, get 500 |
112 |
// Submit the form, get 500 |
| 114 |
cy.intercept("POST", "/api/v1/erm/eholdings/local/packages", { |
113 |
cy.intercept("POST", "/api/v1/erm/eholdings/local/packages", { |
| 115 |
statusCode: 500, |
114 |
statusCode: 500, |
| 116 |
error: "Something went wrong", |
|
|
| 117 |
}); |
115 |
}); |
| 118 |
cy.get("#packages_add").contains("Submit").click(); |
116 |
cy.get("#packages_add").contains("Submit").click(); |
| 119 |
cy.get("main div[class='dialog alert']").contains( |
117 |
cy.get("main div[class='dialog alert']").contains( |
| 120 |
"Something went wrong: SyntaxError: Unexpected end of JSON input" |
118 |
"Something went wrong: Error: Internal Server Error" |
| 121 |
); |
119 |
); |
| 122 |
|
120 |
|
| 123 |
// Submit the form, success! |
121 |
// Submit the form, success! |
|
Lines 187-197
describe("Package CRUD operations", () => {
Link Here
|
| 187 |
// Submit the form, get 500 |
185 |
// Submit the form, get 500 |
| 188 |
cy.intercept("PUT", "/api/v1/erm/eholdings/local/packages/*", { |
186 |
cy.intercept("PUT", "/api/v1/erm/eholdings/local/packages/*", { |
| 189 |
statusCode: 500, |
187 |
statusCode: 500, |
| 190 |
error: "Something went wrong", |
|
|
| 191 |
}); |
188 |
}); |
| 192 |
cy.get("#packages_add").contains("Submit").click(); |
189 |
cy.get("#packages_add").contains("Submit").click(); |
| 193 |
cy.get("main div[class='dialog alert']").contains( |
190 |
cy.get("main div[class='dialog alert']").contains( |
| 194 |
"Something went wrong: SyntaxError: Unexpected end of JSON input" |
191 |
"Something went wrong: Error: Internal Server Error" |
| 195 |
); |
192 |
); |
| 196 |
|
193 |
|
| 197 |
// Submit the form, success! |
194 |
// Submit the form, success! |
|
Lines 304-314
describe("Package CRUD operations", () => {
Link Here
|
| 304 |
// Accept the confirmation dialog, get 500 |
301 |
// Accept the confirmation dialog, get 500 |
| 305 |
cy.intercept("DELETE", "/api/v1/erm/eholdings/local/packages/*", { |
302 |
cy.intercept("DELETE", "/api/v1/erm/eholdings/local/packages/*", { |
| 306 |
statusCode: 500, |
303 |
statusCode: 500, |
| 307 |
error: "Something went wrong", |
|
|
| 308 |
}); |
304 |
}); |
| 309 |
cy.contains("Yes, delete").click(); |
305 |
cy.contains("Yes, delete").click(); |
| 310 |
cy.get("main div[class='dialog alert']").contains( |
306 |
cy.get("main div[class='dialog alert']").contains( |
| 311 |
"Something went wrong: SyntaxError: Unexpected end of JSON input" |
307 |
"Something went wrong: Error: Internal Server Error" |
| 312 |
); |
308 |
); |
| 313 |
|
309 |
|
| 314 |
// Accept the confirmation dialog, success! |
310 |
// Accept the confirmation dialog, success! |