@@ -4,19 +4,7 @@ import ReactDOM from 'react-dom';
44
55import BreadcrumbItem from '../src/BreadcrumbItem' ;
66
7- import { shouldWarn } from './helpers' ;
8-
97describe ( 'BreadcrumbItem' , ( ) => {
10- it ( 'Should warn if `active` and `href` attributes set' , ( ) => {
11- ReactTestUtils . renderIntoDocument (
12- < BreadcrumbItem href = '#' active >
13- Crumb
14- </ BreadcrumbItem >
15- ) ;
16-
17- shouldWarn ( '[react-bootstrap] `href` and `active` properties cannot be set at the same time' ) ;
18- } ) ;
19-
208 it ( 'Should render `a` as inner element when is not active' , ( ) => {
219 const instance = ReactTestUtils . renderIntoDocument (
2210 < BreadcrumbItem href = '#' >
@@ -28,24 +16,31 @@ describe('BreadcrumbItem', () => {
2816 assert . notInclude ( ReactDOM . findDOMNode ( instance ) . className , 'active' ) ;
2917 } ) ;
3018
31- it ( 'Should add ` active` class with `active` attribute set.' , ( ) => {
19+ it ( 'Should render `span. active` with `active` attribute set.' , ( ) => {
3220 const instance = ReactTestUtils . renderIntoDocument (
3321 < BreadcrumbItem active >
3422 Active Crumb
3523 </ BreadcrumbItem >
3624 ) ;
3725
3826 assert . include ( ReactDOM . findDOMNode ( instance ) . className , 'active' ) ;
27+ assert . ok ( ReactTestUtils . findRenderedDOMComponentWithTag ( instance , 'span' ) ) ;
3928 } ) ;
4029
41- it ( 'Should render `span` as inner element when is active ' , ( ) => {
30+ it ( 'Should render `span.active` when active and has href ' , ( ) => {
4231 const instance = ReactTestUtils . renderIntoDocument (
43- < BreadcrumbItem active >
44- Crumb
32+ < BreadcrumbItem href = "#" active >
33+ Active Crumb
4534 </ BreadcrumbItem >
4635 ) ;
4736
48- assert . ok ( ReactTestUtils . findRenderedDOMComponentWithTag ( instance , 'span' ) ) ;
37+ assert . include ( ReactDOM . findDOMNode ( instance ) . className , 'active' ) ;
38+
39+ const spanNode = ReactTestUtils . findRenderedDOMComponentWithTag ( instance , 'span' ) ;
40+ assert . ok ( spanNode ) ;
41+ assert . notOk ( spanNode . hasAttribute ( 'href' ) ) ;
42+
43+ assert . lengthOf ( ReactTestUtils . scryRenderedDOMComponentsWithTag ( instance , 'a' ) , 0 ) ;
4944 } ) ;
5045
5146 it ( 'Should add custom classes onto `li` wrapper element' , ( ) => {
0 commit comments