-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ability to configure which features is enabled for widget (#21)
* feat: when initializing astral added options to filter which widgets to see, also added more detail in readme * chore: changed variable name, docs: updated README file * updating prettier * fixing variable name change * fixing typo * Updating README.md with customization instructions * fixing prettier * test: adding cypress tests for feature filtering (#25) * feat: when initializing astral added options to filter which widgets to see, also added more detail in readme * chore: enabled all widgets * chore: changed variable name, docs: updated README file * test: adding cypress tests to check if enabling of features work --------- Co-authored-by: smalik <smalik@verto.ca> * fix(e2e): chrome ERRCONNRESET bug when running cypress --------- Co-authored-by: shameerrehman <shameerrehman.inbox@gmail.com> Co-authored-by: shameerrehman <94149351+shameerrehman@users.noreply.github.com> Co-authored-by: Cho Yin Yong <choyiny@gmail.com>
- Loading branch information
1 parent
b23082c
commit 15be125
Showing
9 changed files
with
284 additions
and
40 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
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
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,113 @@ | ||
describe("tests the enabling of different features", () => { | ||
it("passes", () => { | ||
//checks contract component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { enabledFeatures: ["Contrast"] }); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-contrast"); | ||
cy.get("astral-screen-reader").should("not.exist"); | ||
cy.get("astral-saturate").should("not.exist"); | ||
cy.get("astral-text-size").should("not.exist"); | ||
cy.get("astral-text-spacing").should("not.exist"); | ||
cy.get("astral-screen-mask").should("not.exist"); | ||
cy.get("astral-line-height").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
|
||
//checks screen reader component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { | ||
enabledFeatures: ["Screen Reader"], | ||
}); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-screen-reader"); | ||
cy.get("astral-contrast").should("not.exist"); | ||
cy.get("astral-saturate").should("not.exist"); | ||
cy.get("astral-text-size").should("not.exist"); | ||
cy.get("astral-text-spacing").should("not.exist"); | ||
cy.get("astral-screen-mask").should("not.exist"); | ||
cy.get("astral-line-height").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
|
||
//checks saturation component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { | ||
enabledFeatures: ["Saturation"], | ||
}); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-saturate"); | ||
cy.get("astral-screen-reader").should("not.exist"); | ||
cy.get("astral-contrast").should("not.exist"); | ||
cy.get("astral-text-size").should("not.exist"); | ||
cy.get("astral-text-spacing").should("not.exist"); | ||
cy.get("astral-screen-mask").should("not.exist"); | ||
cy.get("astral-line-height").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
|
||
//checks text size component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { | ||
enabledFeatures: ["Bigger Text"], | ||
}); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-text-size"); | ||
cy.get("astral-screen-reader").should("not.exist"); | ||
cy.get("astral-contrast").should("not.exist"); | ||
cy.get("astral-saturate").should("not.exist"); | ||
cy.get("astral-text-spacing").should("not.exist"); | ||
cy.get("astral-screen-mask").should("not.exist"); | ||
cy.get("astral-line-height").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
|
||
//checks text spacing component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { | ||
enabledFeatures: ["Text Spacing"], | ||
}); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-text-spacing"); | ||
cy.get("astral-screen-reader").should("not.exist"); | ||
cy.get("astral-contrast").should("not.exist"); | ||
cy.get("astral-saturate").should("not.exist"); | ||
cy.get("astral-text-size").should("not.exist"); | ||
cy.get("astral-screen-mask").should("not.exist"); | ||
cy.get("astral-line-height").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
|
||
//checks screen mask component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { | ||
enabledFeatures: ["Screen Mask"], | ||
}); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-screen-mask"); | ||
cy.get("astral-screen-reader").should("not.exist"); | ||
cy.get("astral-contrast").should("not.exist"); | ||
cy.get("astral-saturate").should("not.exist"); | ||
cy.get("astral-text-size").should("not.exist"); | ||
cy.get("astral-text-spacing").should("not.exist"); | ||
cy.get("astral-line-height").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
|
||
//checks line height component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { | ||
enabledFeatures: ["Line Height"], | ||
}); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-line-height"); | ||
cy.get("astral-screen-reader").should("not.exist"); | ||
cy.get("astral-contrast").should("not.exist"); | ||
cy.get("astral-saturate").should("not.exist"); | ||
cy.get("astral-text-size").should("not.exist"); | ||
cy.get("astral-text-spacing").should("not.exist"); | ||
cy.get("astral-screen-mask").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
}); | ||
}); |
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
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
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
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
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,14 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Astral Accessibility</title> | ||
<link rel="stylesheet" href="styles.css" /> | ||
</head> | ||
<body> | ||
<p>Filter Feature Test</p> | ||
<script src="main.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.