30 lines
635 B
JavaScript
30 lines
635 B
JavaScript
/**
|
|
* 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', () => {
|
|
const header = shallow(
|
|
<Header sections={ encodedBreadcrumb } isEmbedded={ true } />,
|
|
{
|
|
disableLifecycleMethods: true,
|
|
}
|
|
);
|
|
expect( header.text().includes( 'Accounts & Privacy' ) ).toBe(
|
|
false
|
|
);
|
|
expect( header.text().includes( 'Accounts & Privacy' ) ).toBe( true );
|
|
} );
|
|
} );
|