Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse expand arrows #166

Merged
merged 9 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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