Skip to content

Commit

Permalink
chore: update tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
andreancardona committed Dec 5, 2023
1 parent 5238bcf commit 4f39928
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion content/patterns/toolbar/examples/toolbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ <h3 id="rps_label_5">Menu Button (Font Family)</h3>
<td><code>button</code></td>
<td>Indicates the menu is not displayed and that activating the menu button opens the menu.</td>
</tr>
<tr data-test-id="toolbar-menubutton-aria-expanded">
<tr data-test-id="toolbar-menubutton-aria-expanded-true">
<td></td>
<th scope="row"><code>aria-expanded="true"</code></th>
<td><code>button</code></td>
Expand Down
21 changes: 16 additions & 5 deletions test/tests/toolbar_toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const { By, Key } = require('selenium-webdriver');
const assertAriaControls = require('../util/assertAriaControls');
const assertAriaLabelExists = require('../util/assertAriaLabelExists');
const assertAriaRoles = require('../util/assertAriaRoles');
const assertAttributeDNE = require('../util/assertAttributeDNE');
const assertAttributeValues = require('../util/assertAttributeValues');
const assertRovingTabindex = require('../util/assertRovingTabindex');
const assertHasFocus = require('../util/assertHasFocus');
Expand Down Expand Up @@ -297,12 +296,24 @@ ariaTest(
);

ariaTest(
'Font family button has aria-expanded',
'Font family button has aria-expanded=false',
exampleFile,
'toolbar-menubutton-aria-expanded',
'toolbar-menubutton-aria-expanded-false',
async (t) => {
await assertAttributeDNE(t, ex.fontFamilyButtonSelector, 'aria-expanded');
await assertAttributeValues(
t,
ex.fontFamilyButtonSelector,
'aria-expanded',
'false'
);
}
);

ariaTest(
'Font family button has aria-expanded=true',
exampleFile,
'toolbar-menubutton-aria-expanded-true',
async (t) => {
await (
await t.context.session.findElement(By.css(ex.fontFamilyButtonSelector))
).click();
Expand All @@ -311,7 +322,7 @@ ariaTest(
t,
ex.fontFamilyButtonSelector,
'aria-expanded',
'false'
'true'
);
}
);
Expand Down

0 comments on commit 4f39928

Please sign in to comment.