forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[added] Property for animation on Popover and Tooltip
- Loading branch information
1 parent
fb9b3bf
commit 1658142
Showing
4 changed files
with
68 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import ReactTestUtils from 'react/lib/ReactTestUtils'; | ||
import Popover from '../src/Popover'; | ||
|
||
describe('Popover', function () { | ||
it('Should output a popover title and content', function () { | ||
let instance = ReactTestUtils.renderIntoDocument( | ||
<Popover title="Popover title"> | ||
<strong>Popover Content</strong> | ||
</Popover> | ||
); | ||
assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'popover-title')); | ||
assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'popover-content')); | ||
assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'fade')); | ||
assert.ok(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'strong')); | ||
}); | ||
|
||
it('Should not have the fade class if animation is false', function () { | ||
let instance = ReactTestUtils.renderIntoDocument( | ||
<Popover title="Popover title" animation={false}> | ||
<strong>Popover Content</strong> | ||
</Popover> | ||
); | ||
assert.equal(instance.getDOMNode().className.match(/\bfade\b/), null, 'The fade class should not be present'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import ReactTestUtils from 'react/lib/ReactTestUtils'; | ||
import Tooltip from '../src/Tooltip'; | ||
|
||
describe('Tooltip', function () { | ||
it('Should output a tooltip with content', function () { | ||
let instance = ReactTestUtils.renderIntoDocument( | ||
<Tooltip> | ||
<strong>Tooltip Content</strong> | ||
</Tooltip> | ||
); | ||
assert.ok(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'strong')); | ||
assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'fade')); | ||
}); | ||
|
||
it('Should not have the fade class if animation is false', function () { | ||
let instance = ReactTestUtils.renderIntoDocument( | ||
<Tooltip animation={false}> | ||
<strong>Tooltip Content</strong> | ||
</Tooltip> | ||
); | ||
assert.equal(instance.getDOMNode().className.match(/\bfade\b/), null, 'The fade class should not be present'); | ||
}); | ||
}); |