Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andi Braimllari committed May 5, 2024
1 parent 1540f6d commit c81222b
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 104 deletions.
22 changes: 0 additions & 22 deletions cypress/e2e/dismiss-marking-button.cy.js

This file was deleted.

34 changes: 0 additions & 34 deletions cypress/e2e/duplication-text-marking-removal.cy.js

This file was deleted.

31 changes: 31 additions & 0 deletions cypress/e2e/general-flow.cy.js → cypress/e2e/general-flows.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,35 @@ describe("General Quill Flow", () => {
cy.get('[data-test="editor"]').contains("gabmim").should("be.visible");
cy.get('[data-test="marking-span"').contains("gabmim").should("be.visible");
});

it("should only removed selected markings even if they might be duplicated in content", () => {
const totalNumberOfMarkings = 9;

cy.get(".typo").should("not.exist");
cy.get('[data-test="editor"]').type(
"asd Për kryerjen e programeve gabmim asd \nasd Për kryerjen e programeve gabmim asd \nasd Për kryerjen e programeve gabmim asd \nasd Për kryerjen e programeve gabmim asd \n"
);
cy.get('[data-test="dismiss-marking-button"]').should("be.visible");

// TODO: rework?
cy.get('[data-test="marking-card"] ').each((card, index, list) => {
if (index <= 2) {
cy.wrap(card)
.find('[data-test="dismiss-marking-button"]')
.click()
.then(() => {
cy.wrap(card).should("not.exist");
cy.wait(1000);
});
}
});

// TODO: rework?
//final count of markings
cy.get(".typo")
.its("length")
.then((numberOfMarkings) => {
expect(numberOfMarkings).to.equal(totalNumberOfMarkings);
});
});
});
61 changes: 61 additions & 0 deletions cypress/e2e/markings-board.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,65 @@ describe("markings board", () => {
cy.get('[data-test="suggestion"]').contains("është").click();
cy.get('[data-test="editor"]').should("have.text", "saktë është");
});

it("should hide marking types after being disabled and reappear after enabling", () => {
cy.visit("/settings");
cy.get('[data-test="switch-check-testing"]').should("be.checked");
cy.get('[data-test="switch-check-testing"]').click({
multiple: true,
force: true
});
cy.get('[data-test="switch-check-testing"]').should("not.be.checked");
cy.visit("/");
cy.get('[data-test="editor"]').type("Pra shkoi tek zyra. ");
cy.get(".typo-marking-header").should("be.visible");
cy.get(".list-group-item b")
.contains("shkrim pa gabime")
.should("exist");
cy.get(".list-group-item span")
.contains(
"shenjime për fjalë të shkruara gabim, gabime fonetikore, shenja pikësimi"
)
.should("exist");
cy.get('[data-test="editor"]').type("{enter}");
cy.get('[data-test="editor"]').type("Pra kaq.");
cy.get(".typo-marking-header").should("be.visible");
cy.get(".list-group-item b")
.contains("shkrim pa gabime")
.should("exist");
cy.get(".list-group-item span")
.contains(
"shenjime për fjalë të shkruara gabim, gabime fonetikore, shenja pikësimi"
)
.should("exist");
cy.get('[data-test="editor"]').clear();
cy.visit("/settings");
cy.get('[data-test="switch-check-testing"]').should("not.be.checked");
cy.get('[data-test="switch-check-testing"]').click({
multiple: true,
force: true
});
cy.get('[data-test="switch-check-testing"]').should("be.checked");
cy.visit("/");
cy.get('[data-test="editor"]').type("Pra shkoi tek zyra. ");
cy.get('[data-test="marking-span"]').contains("tek").should("exist");
cy.get('[data-test="editor"]').type("{enter}");
});

it("should delete the marking in the editor when the dismiss-marking button is clicked", () => {
cy.get('[data-test="editor"]').type("gabmim ");
cy.get('[data-test="dismiss-marking-button"]').click();
cy.get('[data-test="suggestion"]').should("not.exist");
});

it("should delete the markings in the editor when dismiss-marking buttons are clicked", () => {
const text = "gabmim gabmim";
cy.get('[data-test="editor"]').type(text);
cy.get('[data-test="marking-card"]').each((card) => {
cy.wrap(card).find('[data-test="dismiss-marking-button"]').click();
cy.wrap(card).should("not.exist");
});
cy.get('[data-test="suggestion"]').should("not.be.visible");
cy.get('[data-test="editor"]').should("have.text", text);
});
});
48 changes: 0 additions & 48 deletions cypress/e2e/no-markings-after-disable.cy.js

This file was deleted.

0 comments on commit c81222b

Please sign in to comment.