updated tests

This commit is contained in:
Owen Rees
2023-06-22 13:39:50 +02:00
parent 6f7b840b54
commit ef08aa3a61
28 changed files with 43 additions and 43 deletions
+5 -5
View File
@@ -7,17 +7,17 @@ describe("ThemeSwitcher component", () => {
cy.mount(<ThemeSwitcher />);
// checking that the toggle is there and light mode is active
cy.get("[data-cy='toggle']").should("exist");
cy.get("[data-cy='toggle']").should(($toggle) => {
cy.getByData("toggle").should("exist");
cy.getByData("toggle").should(($toggle) => {
const backgroundImage = $toggle.css("background-image");
expect(backgroundImage).to.include(
"linear-gradient(rgb(0, 255, 255), rgb(135, 206, 235)"
);
});
// checking that the toggle is clickable and dark mode is active
cy.get("[data-cy='toggle']").click();
cy.get("[data-cy='toggle-dark']").should("exist");
cy.get("[data-cy='toggle-dark']").should(($toggle) => {
cy.getByData("toggle").click();
cy.getByData("toggle-dark").should("exist");
cy.getByData("toggle-dark").should(($toggle) => {
const backgroundImage = $toggle.css("background-image");
expect(backgroundImage).to.include(
"linear-gradient(rgb(25, 25, 112), rgb(102, 51, 153)"