Lines 21-52
function get_items() {
Link Here
|
21 |
}, |
21 |
}, |
22 |
]; |
22 |
]; |
23 |
} |
23 |
} |
|
|
24 |
let config = { |
25 |
permissions: { manage_sysprefs: "1" }, |
26 |
settings: { |
27 |
enabled: "1", |
28 |
not_for_loan_default_train_in: "42", |
29 |
not_for_loan_waiting_list_in: "24", |
30 |
}, |
31 |
}; |
24 |
describe("WaitingList", () => { |
32 |
describe("WaitingList", () => { |
25 |
beforeEach(() => { |
33 |
beforeEach(() => { |
26 |
cy.login(); |
34 |
cy.login(); |
27 |
cy.title().should("eq", "Koha staff interface"); |
35 |
cy.title().should("eq", "Koha staff interface"); |
28 |
cy.intercept( |
36 |
cy.intercept( |
29 |
"GET", |
37 |
"GET", |
30 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=PreservationModule", |
38 |
"/api/v1/preservation/config", |
31 |
'{"value":"1"}' |
39 |
JSON.stringify(config) |
32 |
); |
|
|
33 |
cy.intercept( |
34 |
"GET", |
35 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=PreservationNotForLoanWaitingListIn", |
36 |
'{"value":"24"}' |
37 |
); |
38 |
cy.intercept( |
39 |
"GET", |
40 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=PreservationNotForLoanDefaultTrainIn", |
41 |
'{"value":"42"}' |
42 |
); |
40 |
); |
43 |
}); |
41 |
}); |
44 |
|
42 |
|
45 |
it("List", () => { |
43 |
it("List", () => { |
|
|
44 |
config.settings.not_for_loan_waiting_list_in = ""; |
46 |
cy.intercept( |
45 |
cy.intercept( |
47 |
"GET", |
46 |
"GET", |
48 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=PreservationNotForLoanWaitingListIn", |
47 |
"/api/v1/preservation/config", |
49 |
'{"value":""}' |
48 |
JSON.stringify(config) |
50 |
); |
49 |
); |
51 |
cy.visit("/cgi-bin/koha/preservation/home.pl"); |
50 |
cy.visit("/cgi-bin/koha/preservation/home.pl"); |
52 |
cy.intercept("GET", "/api/v1/preservation/waiting-list/items*", []); |
51 |
cy.intercept("GET", "/api/v1/preservation/waiting-list/items*", []); |
Lines 55-64
describe("WaitingList", () => {
Link Here
|
55 |
"You need to configure this module first." |
54 |
"You need to configure this module first." |
56 |
); |
55 |
); |
57 |
|
56 |
|
|
|
57 |
config.settings.not_for_loan_waiting_list_in = "42"; |
58 |
cy.intercept( |
58 |
cy.intercept( |
59 |
"GET", |
59 |
"GET", |
60 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=PreservationNotForLoanWaitingListIn", |
60 |
"/api/v1/preservation/config", |
61 |
'{"value":"42"}' |
61 |
JSON.stringify(config) |
62 |
); |
62 |
); |
63 |
cy.visit("/cgi-bin/koha/preservation/home.pl"); |
63 |
cy.visit("/cgi-bin/koha/preservation/home.pl"); |
64 |
cy.intercept("GET", "/api/v1/preservation/waiting-list/items*", []); |
64 |
cy.intercept("GET", "/api/v1/preservation/waiting-list/items*", []); |
Lines 73-79
describe("WaitingList", () => {
Link Here
|
73 |
cy.visit("/cgi-bin/koha/preservation/waiting-list"); |
73 |
cy.visit("/cgi-bin/koha/preservation/waiting-list"); |
74 |
cy.intercept("POST", "/api/v1/preservation/waiting-list/items", { |
74 |
cy.intercept("POST", "/api/v1/preservation/waiting-list/items", { |
75 |
statusCode: 500, |
75 |
statusCode: 500, |
76 |
error: "Something went wrong", |
|
|
77 |
}); |
76 |
}); |
78 |
cy.get("#waiting-list").contains("Add to waiting list").click(); |
77 |
cy.get("#waiting-list").contains("Add to waiting list").click(); |
79 |
cy.get("#barcode_list").type("bc_1\nbc_2\nbc_3"); |
78 |
cy.get("#barcode_list").type("bc_1\nbc_2\nbc_3"); |
Lines 117-123
describe("WaitingList", () => {
Link Here
|
117 |
// Submit the form, get 500 |
116 |
// Submit the form, get 500 |
118 |
cy.intercept("DELETE", "/api/v1/preservation/waiting-list/items/*", { |
117 |
cy.intercept("DELETE", "/api/v1/preservation/waiting-list/items/*", { |
119 |
statusCode: 500, |
118 |
statusCode: 500, |
120 |
error: "Something went wrong", |
|
|
121 |
}); |
119 |
}); |
122 |
cy.get("#waiting-list table tbody tr:first").contains("Remove").click(); |
120 |
cy.get("#waiting-list table tbody tr:first").contains("Remove").click(); |
123 |
cy.contains("Yes, remove").click(); |
121 |
cy.contains("Yes, remove").click(); |
124 |
- |
|
|