woocommerce/plugins/woocommerce-admin/client/header/test/index.js

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 &amp; Privacy' ) ).toBe(
false
);
expect( header.text().includes( 'Accounts & Privacy' ) ).toBe( true );
} );
} );