Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
CGPROD-1585 Accessible DOM element (#287)
Browse files Browse the repository at this point in the history
* Calls to 'visible' on accessible dom elements now reliable after creation.

* Update test
  • Loading branch information
FostUK authored Aug 5, 2019
1 parent 546676e commit f180c2b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

| Version | Description |
|---------|-------------|
| 2.0.5 | |
| | Calls to 'visible' on accessible dom elements now reliable after creation. (CGPROD-1585) |
| 2.0.4 | |
| | Button accessibility hot fix. (CGPROD-1577) |
| 2.0.3 | |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "genie",
"version": "2.0.4",
"version": "2.0.5",
"description": "Genie - A Modular Game Engine",
"license": "Apache-2.0",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion src/core/accessibility/accessible-dom-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function accessibleDomElement(options) {
}

function visible() {
return el.style.visibility === "visible";
return el.style.visibility !== "hidden";
}

function position(positionOptions) {
Expand Down
5 changes: 5 additions & 0 deletions test/core/accessibility/accessible-dom-element.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ describe("Accessible DOM Element", () => {
});

describe("checking visibility of mockElement", () => {
test("calling visible function returns true when mockElement has been created", () => {
const newAccessibleElement = accessibleDomElement(options);
expect(newAccessibleElement.visible()).toBe(true);
});

test("calling visible function returns true when mockElement is visible", () => {
const newAccessibleElement = accessibleDomElement(options);
newAccessibleElement.show();
Expand Down

0 comments on commit f180c2b

Please sign in to comment.