Skip to content

Commit

Permalink
Merge pull request #166 from OpenCovenant/collapse-expand-arrows
Browse files Browse the repository at this point in the history
Collapse expand arrows
  • Loading branch information
AndersonCeci authored May 3, 2023
2 parents 01b1cbf + f02fb27 commit 22f0dea
Show file tree
Hide file tree
Showing 4 changed files with 970 additions and 3 deletions.
41 changes: 41 additions & 0 deletions cypress/e2e/expand-arrow.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
describe("click on expand/collapse arrow and then choose on a suggestion and check if it exist on editor", () => {
beforeEach(() => {
cy.visit("/");
});

it("will click on the expand/collapse arrows and then choose on a suggestion", () => {
cy.get('[data-test="editor"]').type("sakt eshte");
cy.get('[data-test="suggestion"]').children().should("have.length", 8);
cy.get(
'[data-test="oscillate-suggestions-button"].bi-arrow-right-square'
).first().click();
cy.get(
'[data-test="oscillate-suggestions-button"].bi-arrow-right-square'
).click();
cy.get('[data-test="suggestion"]')
.children()
.should("have.length.gt", 8);
cy.get(
'[data-test="oscillate-suggestions-button"].bi-arrow-left-square'
).first().click();
cy.get(
'[data-test="oscillate-suggestions-button"].bi-arrow-left-square'
).click();
cy.get('[data-test="suggestion"]').children().should("have.length", 8);
cy.get(
'[data-test="oscillate-suggestions-button"].bi-arrow-right-square'
).first().click();
cy.get(
'[data-test="oscillate-suggestions-button"].bi-arrow-right-square'
).click();
cy.get('[data-test="suggestion"]')
.children()
.should("have.length.gt", 8);
cy.get('[data-test="suggestion"]').contains("saktë").click();
cy.get(
'[data-test="oscillate-suggestions-button"].bi-arrow-right-square'
).click();
cy.get('[data-test="suggestion"]').contains("është").click();
cy.get('[data-test="editor"]').should("have.text", "saktë është");
});
});
29 changes: 26 additions & 3 deletions cypress/e2e/general-flow.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,43 @@ describe("a general flow of quill", () => {
});

it("will mark typos in the editor", () => {
cy.get("#editor > p > .typo").should("not.exist");
cy.get('[data-test="editor"] > p > .typo').should("not.exist");
cy.get('[data-test="editor"]').type("gabmim ");
cy.get("#editor > p > .typo").should("exist");
cy.get('[data-test="editor"] > p > .typo').should("exist");
});

it("will mark loanwords in the editor", () => {
cy.get('[data-test="editor"] > p > .loanword').should("not.exist");
cy.get('[data-test="editor"]').type("lider ");
cy.get("#editor > p > .loanword").should("exist");
cy.get('[data-test="editor"] > p > .loanword').should("exist");
});

it("will test if Opening and closing the offcanvas works as expected.", () => {
cy.get('[data-test="navbar-toggler-icon"]').click();
cy.get(".offcanvas.offcanvas-start.show").should("exist");
cy.get('[data-test="close-offcanvas-button"]').click();
});

it("will click on the expand/collapse arrows and then choose on a suggestion", () => {
cy.get('[data-test="editor"]').type("eshte");
cy.get('[data-test="suggestion"]').children().should("have.length", 4);
cy.get(
'[data-test="oscillate-suggestions-button"].bi-arrow-right-square'
).click();
cy.get('[data-test="suggestion"]')
.children()
.should("have.length.gt", 4);
cy.get(
'[data-test="oscillate-suggestions-button"].bi-arrow-left-square'
).click();
cy.get('[data-test="suggestion"]').children().should("have.length", 4);
cy.get(
'[data-test="oscillate-suggestions-button"].bi-arrow-right-square'
).click();
cy.get('[data-test="suggestion"]')
.children()
.should("have.length.gt", 4);
cy.get('[data-test="suggestion"]').contains("është").click();
cy.get('[data-test="editor"]').should("have.text", "është");
});
});
Loading

0 comments on commit 22f0dea

Please sign in to comment.