|
Lines 180-183
describe("Dialog operations", () => {
Link Here
|
| 180 |
.contains("deleted"); |
180 |
.contains("deleted"); |
| 181 |
cy.get("main div[class='alert alert-info']").should("have.length", 1); |
181 |
cy.get("main div[class='alert alert-info']").should("have.length", 1); |
| 182 |
}); |
182 |
}); |
|
|
183 |
|
| 184 |
it("Confirmation messages with inputs", () => { |
| 185 |
const dataProvider = cy.get_usage_data_provider(); |
| 186 |
const dataProviders = [dataProvider]; |
| 187 |
|
| 188 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
| 189 |
statusCode: 200, |
| 190 |
body: dataProviders, |
| 191 |
headers: { |
| 192 |
"X-Base-Total-Count": "1", |
| 193 |
"X-Total-Count": "1", |
| 194 |
}, |
| 195 |
}); |
| 196 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers/*", dataProvider); |
| 197 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers"); |
| 198 |
|
| 199 |
cy.get("#usage_data_providers_list table tbody tr:first") |
| 200 |
.contains("Run now") |
| 201 |
.click(); |
| 202 |
cy.get(".modal.confirmation p").contains(dataProvider.name); |
| 203 |
cy.get("body").click(0, 0); |
| 204 |
|
| 205 |
cy.get("#usage_data_providers_list table tbody tr:first") |
| 206 |
.contains("Run now") |
| 207 |
.click(); |
| 208 |
|
| 209 |
cy.intercept( |
| 210 |
"POST", |
| 211 |
"/api/v1/erm/usage_data_providers/1/process_SUSHI_response*", |
| 212 |
{ |
| 213 |
statusCode: 200, |
| 214 |
body: { |
| 215 |
jobs: [ |
| 216 |
{ |
| 217 |
report_type: "TR_J1", |
| 218 |
job_id: 1, |
| 219 |
}, |
| 220 |
], |
| 221 |
}, |
| 222 |
headers: { |
| 223 |
"X-Base-Total-Count": "1", |
| 224 |
"X-Total-Count": "1", |
| 225 |
}, |
| 226 |
} |
| 227 |
); |
| 228 |
cy.get("#begin_date+input").click(); |
| 229 |
cy.get(".flatpickr-current-month select") |
| 230 |
.invoke("val") |
| 231 |
.then(month => { |
| 232 |
cy.get(".flatpickr-current-month > select > option").eq(0); |
| 233 |
cy.get(".dayContainer").contains(new RegExp("^1$")).click(); |
| 234 |
}); |
| 235 |
cy.get("#accept_modal").click(); |
| 236 |
cy.get("main div[class='alert alert-info']").should( |
| 237 |
"have.text", |
| 238 |
"Job for report type TR_J1 has been queued. Check job progress." |
| 239 |
); |
| 240 |
}); |
| 183 |
}); |
241 |
}); |
| 184 |
- |
|
|