Skip to content

Commit

Permalink
Use documented methods
Browse files Browse the repository at this point in the history
  • Loading branch information
goodguyry committed Apr 21, 2020
1 parent 4795b2a commit 4e58d45
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Disclosure/Disclosure.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('Disclosure with default configuration', () => {
expect(target.getAttribute('hidden')).toEqual('');

// Re-open the disclosure.
disclosure.setState({ expanded: true });
disclosure.open();
// Should close on outside click.
document.body.dispatchEvent(click);
expect(disclosure.getState().expanded).toBeTruthy();
Expand All @@ -85,7 +85,7 @@ describe('Disclosure with default configuration', () => {

it('Should update attributes when Return or Spacebar are pressed', () => {
// Ensure the disclosure is closed.
disclosure.setState({ expanded: false });
disclosure.close();

// Return to open.
controller.dispatchEvent(keydownReturn);
Expand Down
4 changes: 2 additions & 2 deletions src/MenuBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export default class MenuBar extends AriaComponent {

// Close the popup.
if (popup) {
popup.setState({ expanded: false });
popup.hide();
}

this.setState({
Expand All @@ -346,7 +346,7 @@ export default class MenuBar extends AriaComponent {
event.preventDefault();

if (! popup.state.expanded) {
popup.setState({ expanded: true });
popup.show();
}

popup.firstInteractiveChild.focus();
Expand Down
2 changes: 1 addition & 1 deletion src/Popup/Popup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('Popup adds and manipulates DOM element attributes', () => {
describe('Popup correctly responds to events', () => {
// Ensure the popup is open before all tests.
beforeEach(() => {
popup.setState({ expanded: true });
popup.show();
});

it('Should close the popup when the ESC key is pressed',
Expand Down

0 comments on commit 4e58d45

Please sign in to comment.