Skip to content

Commit

Permalink
Test for opened modal to have not aria-hidden set to true
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Kallunki committed Oct 4, 2018
1 parent 21abdf8 commit 4952711
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/material-ui/src/Modal/ModalManager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,21 @@ describe('ModalManager', () => {
document.body.removeChild(container2);
});

it('should not contain aria-hidden on modal', () => {
const modal2 = document.createElement('div');

modalManager.add(modal2, container2);
assert.strictEqual(modal2.getAttribute('aria-hidden'), null);
});

it('should add aria-hidden to container siblings', () => {
modalManager.add({}, container2);
assert.strictEqual(mountNode1.getAttribute('aria-hidden'), 'true');
});

it('should add aria-hidden to previous modals', () => {
const modal2 = {};
const modal3 = {};
const modal3 = document.createElement('div');
const mountNode2 = document.createElement('div');

modal2.mountNode = mountNode2;
Expand All @@ -155,6 +162,7 @@ describe('ModalManager', () => {
modalManager.add(modal3, container2);
assert.strictEqual(mountNode1.getAttribute('aria-hidden'), 'true');
assert.strictEqual(mountNode2.getAttribute('aria-hidden'), 'true');
assert.strictEqual(modal3.getAttribute('aria-hidden'), null);
});

it('should remove aria-hidden on americas next top modal', () => {
Expand Down

0 comments on commit 4952711

Please sign in to comment.