-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multiple animation for marked suggestion added (#360)
* multiple animation for marked suggestion added * duplicated text markings issue resolved * test files for card's suggestion animation * empty test file fix
- Loading branch information
1 parent
cd12de6
commit 944a158
Showing
6 changed files
with
1,154 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
describe("Test animation during multiple suggestion selections", () => { | ||
beforeEach(() => { | ||
cy.visit("/"); | ||
}); | ||
|
||
it("should select suggestions for all cards and display smooth animation", () => { | ||
cy.get("#editor > p > .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.wait(2000); | ||
|
||
cy.get(".sticky .card").each((card, index) => { | ||
cy.wrap(card).find('[data-test="suggestion"]').first().click(); | ||
cy.wait(2000) | ||
|
||
}); | ||
|
||
cy.get("#editor > p > .typo").should("not.exist"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
describe("Test request after suggestion selection", () => { | ||
beforeEach(() => { | ||
cy.visit("/"); | ||
}); | ||
|
||
it("should make a post request after rapidly selecting suggestions from cards", () => { | ||
cy.get("#editor > p > .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.wait(2000); | ||
|
||
cy.get(".sticky .card").each((card, index) => { | ||
if(index < 9){ | ||
cy.wrap(card).find('[data-test="suggestion"]').first().click(); | ||
} | ||
}); | ||
|
||
cy.wait(5000) | ||
|
||
cy.intercept("POST", 'http://localhost:3000/api/generateMarkingsForParagraphs').as("postRequest"); | ||
cy.wait("@postRequest").then((interception) => { | ||
// we only need this to be true regardless of the status code | ||
expect(interception.response.statusCode).to.equal(404); | ||
}); | ||
|
||
|
||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
describe("Test editor marking's change in text", () => { | ||
beforeEach(() => { | ||
cy.visit("/"); | ||
}); | ||
|
||
it("should reflect rapid changes in text when selecting multiple suggestions", () => { | ||
let shouldBe = "aks Për kryerjen e programeve gazmim aso aks Për kryerjen e programeve gazmim aso aks Për kryerjen e programeve gazmim aso aks Për kryerjen e programeve gazmim aso " | ||
|
||
cy.get("#editor > p > .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.wait(2000); | ||
|
||
cy.get(".sticky .card").each((card, index) => { | ||
cy.wrap(card).find('[data-test="suggestion"]').first().click(); | ||
}); | ||
|
||
cy.wait(3000) | ||
cy.get('#editor > p').invoke('text').then((actualText) => { | ||
actualText = actualText.replace(/\s+/g, ' ').trim(); | ||
shouldBe = shouldBe.replace(/\s+/g, ' ').trim(); | ||
|
||
expect(actualText).to.equal(shouldBe); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.