Skip to content

Commit

Permalink
[test] Make SpeedDial test StrictMode compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jun 24, 2021
1 parent 80926d9 commit dfcfc36
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/material-ui/src/SpeedDial/SpeedDial.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ describe('<SpeedDial />', () => {
clock.restore();
});

// StrictModeViolation: not using act(), prefer test/utils/createClientRender
const mount = createMount({ strict: false });
const render = createClientRender({ strict: false });
const mount = createMount();
const render = createClientRender();

const icon = <Icon>font_icon</Icon>;
const FakeAction = () => <div />;
Expand Down Expand Up @@ -203,8 +202,8 @@ describe('<SpeedDial />', () => {
</SpeedDial>,
);
const fab = getByRole('button');
fab.focus();
act(() => {
fab.focus();
clock.tick();
});
expect(handleOpen.callCount).to.equal(1);
Expand All @@ -226,8 +225,8 @@ describe('<SpeedDial />', () => {
const fab = getByRole('button');
const actions = getAllByRole('menuitem');

fab.focus();
act(() => {
fab.focus();
clock.runAll();
});

Expand Down Expand Up @@ -301,7 +300,9 @@ describe('<SpeedDial />', () => {
))}
</SpeedDial>,
);
fabButton.focus();
act(() => {
fabButton.focus();
});
};

/**
Expand Down

0 comments on commit dfcfc36

Please sign in to comment.