Skip to content

Commit

Permalink
Merge pull request #168 from OpenCovenant/editor_focus_on_different_r…
Browse files Browse the repository at this point in the history
…esolutions

Created this test to check focus on diffrent resolutions
  • Loading branch information
AndersonCeci committed May 5, 2023
2 parents 25ac9c5 + a8a46a6 commit 01f574d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions cypress/e2e/automatically-focus-on-editor.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe("it will check if the focus is on editor on desktop and not in mobiles", () => {
context("720p resolution", () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.visit("/");
});

it("tests on resolution 1280-720 (desktop)", () => {
cy.focused().should("have.attr", "id", "editor");
});
});

context("iphone-7", () => {
beforeEach(() => {
cy.viewport("iphone-7");
cy.visit("/");
});

it("tests on iphone 7 resolution 375-667", () => {
cy.focused().should("not.exist");
});
});
});

0 comments on commit 01f574d

Please sign in to comment.