Skip to content

Commit

Permalink
[refactored] firevent inside act
Browse files Browse the repository at this point in the history
  • Loading branch information
SarthakC committed Nov 2, 2019
1 parent 8f6a480 commit 777fa1a
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions packages/material-ui/src/Select/Select.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ describe('<Select />', () => {
it('should focus list if no selection', () => {
const { getByRole } = render(<Select value="" autoFocus />);

act(() => {
fireEvent.mouseDown(getByRole('button'));
});
fireEvent.mouseDown(getByRole('button'));

// TODO not matching WAI-ARIA authoring practices. It should focus the first (or selected) item.
expect(getByRole('listbox')).to.be.focused;
Expand Down Expand Up @@ -612,9 +610,7 @@ describe('<Select />', () => {
}
const { getByRole, queryByRole } = render(<ControlledWrapper />);

act(() => {
fireEvent.mouseDown(getByRole('button'));
});
fireEvent.mouseDown(getByRole('button'));

expect(getByRole('listbox')).to.be.ok;

Expand Down Expand Up @@ -655,9 +651,7 @@ describe('<Select />', () => {
const button = getByRole('button');
stub(button, 'clientWidth').get(() => 14);

act(() => {
fireEvent.mouseDown(button);
});
fireEvent.mouseDown(button);

expect(getByTestId('paper').style).to.have.property('minWidth', '14px');
});
Expand All @@ -671,9 +665,7 @@ describe('<Select />', () => {
const button = getByRole('button');
stub(button, 'clientWidth').get(() => 14);

act(() => {
fireEvent.mouseDown(button);
});
fireEvent.mouseDown(button);

expect(getByTestId('paper').style).to.have.property('minWidth', '');
});
Expand Down

0 comments on commit 777fa1a

Please sign in to comment.