2020-02-05 19:35:50 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { shallow } from 'enzyme';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import Header from '../index.js';
|
|
|
|
|
|
|
|
const encodedBreadcrumb = [
|
|
|
|
[ 'admin.php?page=wc-settings', 'Settings' ],
|
|
|
|
'Accounts & Privacy',
|
|
|
|
];
|
|
|
|
|
|
|
|
describe( 'Header', () => {
|
|
|
|
test( 'should render decoded breadcrumb name', () => {
|
2020-02-14 02:23:21 +00:00
|
|
|
const header = shallow(
|
|
|
|
<Header sections={ encodedBreadcrumb } isEmbedded={ true } />,
|
|
|
|
{
|
|
|
|
disableLifecycleMethods: true,
|
|
|
|
}
|
|
|
|
);
|
|
|
|
expect( header.text().includes( 'Accounts & Privacy' ) ).toBe(
|
|
|
|
false
|
|
|
|
);
|
2020-02-05 19:35:50 +00:00
|
|
|
expect( header.text().includes( 'Accounts & Privacy' ) ).toBe( true );
|
|
|
|
} );
|
|
|
|
} );
|