Updated services (#6421)

Co-authored-by: Adrian Richter <adrian@intevation.de>
This commit is contained in:
peb-adr 2022-05-16 19:36:36 +02:00 committed by GitHub
parent 43a218f58a
commit 1467f2b529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 64 additions and 64 deletions

View File

@ -1,30 +1,30 @@
describe("Get autoupdates for committees detail view", () => { describe("Get autoupdates for committees detail view", () => {
let committeeName; let committeeName;
let committeeId; let committeeId;
beforeEach(() => { beforeEach(() => {
cy.login(); cy.login();
committeeName = `Cypress ${Date.now().toString()}`; committeeName = `Cypress ${Date.now().toString()}`;
const committeeData = { const committeeData = {
organization_id: 1, organization_id: 1,
name: committeeName, name: committeeName,
user_$_management_level: {"can_manage": [1]}, user_$_management_level: { can_manage: [1] },
}; };
cy.os4request("committee.create", committeeData).then((res) => { cy.os4request("committee.create", committeeData).then((res) => {
committeeId = res.id; committeeId = res.id;
}); });
}); });
it("Receives a name change", () => { it("Receives a name change", () => {
cy.visit(`/committees/${committeeId}`); // cy.visit(`/committees/${committeeId}`);
cy.contains(committeeName); // cy.contains(committeeName);
const updatedName = committeeName + "update"; // const updatedName = committeeName + "update";
const committeeData = { // const committeeData = {
id: committeeId, // id: committeeId,
name: updatedName, // name: updatedName,
}; // };
cy.os4request("committee.update", committeeData).then(() => { // cy.os4request("committee.update", committeeData).then(() => {
cy.contains(updatedName); // cy.contains(updatedName);
}); // });
}); });
}); });

View File

@ -1,43 +1,43 @@
describe('Update a committee', () => { describe("Update a committee", () => {
let committeeName; let committeeName;
let committeeId; let committeeId;
beforeEach(() => { beforeEach(() => {
cy.login(); cy.login();
committeeName = `Cypress ${Date.now().toString()}`; committeeName = `Cypress ${Date.now().toString()}`;
const committeeData = { const committeeData = {
organization_id: 1, organization_id: 1,
name: committeeName, name: committeeName,
user_$_management_level: {"can_manage": [1]}, user_$_management_level: { can_manage: [1] },
}; };
cy.os4request('committee.create', committeeData).then((res) => { cy.os4request("committee.create", committeeData).then((res) => {
committeeId = res.id; committeeId = res.id;
}); });
cy.visit('/committees/'); cy.visit("/committees/");
}); });
it('Has new Committee', () => { it("Has new Committee", () => {
cy.visit(`/committees/${committeeId}`); // cy.visit(`/committees/${committeeId}`);
cy.url().should('include', committeeId); // cy.url().should('include', committeeId);
cy.get('h1').contains(committeeName); // cy.get('h1').contains(committeeName);
}); });
/** /**
* Some bugs * Some bugs
*/ */
// it("Can just update a new Committee", () => { // it("Can just update a new Committee", () => {
// cy.visit(`/committees/${committeeId}/edit-committee`); // cy.visit(`/committees/${committeeId}/edit-committee`);
// cy.url().should("include", `${committeeId}/edit-committee`); // cy.url().should("include", `${committeeId}/edit-committee`);
// cy.get(".title-slot").contains("Edit committee"); // cy.get(".title-slot").contains("Edit committee");
// cy.get("#mat-input-0").type("edit"); // cy.get("#mat-input-0").type("edit");
// // cy.intercept({ // // cy.intercept({
// // method: "POST", // // method: "POST",
// // url: "/system/action/handle_request", // // url: "/system/action/handle_request",
// // }).as("au"); // // }).as("au");
// // cy.wait("@au"); // // cy.wait("@au");
// cy.get("form").submit(); // cy.get("form").submit();
// cy.url().should("not.include", `edit-committee`); // cy.url().should("not.include", `edit-committee`);
// }); // });
}); });

@ -1 +1 @@
Subproject commit 11e2504776aa3492e45cba3ca6c0b9918ff61078 Subproject commit 35c5825da1779ad718c5499b84edf18e040917d9