Skip to content

Commit

Permalink
[ci] Rewrite test 13-test-admin-configure-custom-texts.cy.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Oct 23, 2024
1 parent f36ef85 commit 945b0a3
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions client/cypress/e2e/13-test-admin-configure-custom-texts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,45 @@ describe("admin disable submissions", () => {
});
});

describe("admin configure custom texts", () => {
describe("admin update custom texts (1)", () => {
it("should perform custom texts configuration", () => {
cy.login_admin();
cy.visit("/#/admin/settings");
cy.get('[data-cy="text_customization"]').click();

cy.get('select[name="vars.text_to_customize"]').select("Submissions disabled");

cy.get("[name='vars.custom_text']").clear().type("Whistleblowing disabled");

cy.get("#addCustomTextButton").click();
cy.logout();
});
});

cy.reload();
describe("users should see updates of custom texts (1)", () => {
it("should test custom texts", () => {
cy.visit("/#/");
cy.waitForUrl("/#/")
cy.get('#submissions_disabled').should('contain', 'Whistleblowing disabled');
});
});

describe("admin update custom texts (2)", () => {
it("should perform custom texts configuration", () => {
cy.login_admin();
cy.visit("/#/admin/settings");
cy.get('[data-cy="text_customization"]').click();

cy.get(".deleteCustomTextButton").click();
cy.get(".deleteCustomTextButton").click();

cy.logout();
});
});

describe("users should see updates of custom texts (2)", () => {
it("should test custom texts", () => {
cy.visit("/#/");
cy.reload();
cy.get('#submissions_disabled').should('not.contain', 'Whistleblowing disabled');
});
});

describe("admin enable submissions", () => {
it("should enable submission", () => {
return;
cy.login_admin();
cy.visit("/#/admin/settings");
cy.get('[data-cy="advanced"]').click();
Expand All @@ -60,4 +67,4 @@ describe("admin enable submissions", () => {
cy.visit("/#/");
cy.get("#WhistleblowingButton").should("be.visible");
});
});
});

0 comments on commit 945b0a3

Please sign in to comment.