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 1e9c140 commit 6ab8adb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
5 changes: 4 additions & 1 deletion cypress/e2e/dark-mode-button-functionality-test.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,31 @@ describe("Dark Mode Toggle and Reload Check", () => {
cy.get('[data-test="dark-mode-button-toggle-switch"]').should(
"not.be.checked"
);

cy.get('[data-test="dark-mode-button-toggle-switch"]').click({
force: true
});
cy.get('[data-test="dark-mode-button-toggle-switch"]').should(
"be.checked"
);

cy.reload();
cy.get('[data-test="navbar-toggler-icon"]').click();
cy.get('[data-test="dark-mode-button-toggle-switch"]').should(
"be.checked"
);

cy.get('[data-test="dark-mode-button-toggle-switch"]').click({
force: true
});
cy.get('[data-test="dark-mode-button-toggle-switch"]').should(
"not.be.checked"
);

cy.reload();
cy.get('[data-test="navbar-toggler-icon"]').click();
cy.get('[data-test="dark-mode-button-toggle-switch"]').should(
"not.be.checked"
);
cy.reload();
});
});
15 changes: 3 additions & 12 deletions cypress/e2e/dark-mode-local-storage.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ describe("Dark Mode Local Storage Check", () => {

it("should correctly update the dark mode status in local storage", () => {
cy.window().then((win) => {
const localStorageValue =
win.localStorage.getItem("penda-dark-mode");

expect(localStorageValue).to.equal("false");
expect(win.localStorage.getItem("penda-dark-mode")).to.equal("false");
});

cy.get('[data-test="navbar-toggler-icon"]').click();
Expand All @@ -21,10 +18,7 @@ describe("Dark Mode Local Storage Check", () => {
});
cy.reload();
cy.window().then((win) => {
const localStorageValue =
win.localStorage.getItem("penda-dark-mode");

expect(localStorageValue).to.equal("true");
expect(win.localStorage.getItem("penda-dark-mode")).to.equal("true");
});

cy.get('[data-test="navbar-toggler-icon"]').click();
Expand All @@ -33,10 +27,7 @@ describe("Dark Mode Local Storage Check", () => {
});
cy.reload();
cy.window().then((win) => {
const localStorageValue =
win.localStorage.getItem("penda-dark-mode");

expect(localStorageValue).to.equal("false");
expect(win.localStorage.getItem("penda-dark-mode")).to.equal("false");
});
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe("Focus on Editor - Resolution Testing", () => {
context("Desktop - 720p Resolution", () => {
describe("editor focus on different resolutions", () => {
context("Desktop - 1280x720 Resolution", () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.visit("/");
Expand Down

0 comments on commit 6ab8adb

Please sign in to comment.