Skip to content

Commit

Permalink
Add setTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwooding committed Apr 9, 2019
1 parent c4f745a commit e554936
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/material-ui/src/Tooltip/Tooltip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,22 @@ describe('<Tooltip />', () => {
describe('prop: title', () => {
it('should display if the title is present', () => {
const wrapper = mount(<Tooltip {...defaultProps} open />);
assert.strictEqual(wrapper.find(Popper).props().open, true);

assert.strictEqual(wrapper.find(Popper).props().open, false);
// Wait for ref to be set
setTimeout(() => {
assert.strictEqual(wrapper.find(Popper).props().open, true);
});
});

it('should not display if the title is an empty string', () => {
const wrapper = mount(<Tooltip {...defaultProps} title="" open />);

assert.strictEqual(wrapper.find(Popper).props().open, false);
// Wait for ref to be set
setTimeout(() => {
assert.strictEqual(wrapper.find(Popper).props().open, false);
});
});

it('should be passed down to the child as a native title', () => {
Expand Down

0 comments on commit e554936

Please sign in to comment.