Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ SOFTWARE.
*/

import { shallow } from 'enzyme';
import HeaderBAM from '../../src/header/HeaderBAM';
import HeaderAuthentication from '../../src/header/HeaderAuthentication';

jest.unmock('../../src/header/HeaderBAM');
jest.unmock('../../src/header/HeaderAuthentication');

jest.mock('../../src/hooks/usePlatformData', () =>
jest.fn(() => {
return {
data: {
user: {
bam_info: {
authentication_info: {
alias: 'Bam1',
url: '192.168.10.2',
},
Expand All @@ -40,15 +40,17 @@ jest.mock('../../src/hooks/usePlatformData', () =>
}),
);

describe('HeaderBAM', () => {
describe('HeaderAuthentication', () => {
describe('Rendering', () => {
it('Render HeaderBAM component with default props', () => {
const wrapper = shallow(<HeaderBAM />);
it('Render HeaderAuthentication component with default props', () => {
const wrapper = shallow(<HeaderAuthentication />);
expect(wrapper.getElement()).toMatchSnapshot();
});

it('Render HeaderBAM component with props', () => {
const wrapper = shallow(<HeaderBAM className='varClassName' />);
it('Render HeaderAuthentication component with props', () => {
const wrapper = shallow(
<HeaderAuthentication className='varClassName' />,
);
expect(wrapper.getElement()).toMatchSnapshot();
});
});
Expand Down
4 changes: 2 additions & 2 deletions __tests__/components/__snapshots__/Header.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ exports[`Header Rendering Render Header component with default props 1`] = `
<div
className="Header__rightSideMenu"
>
<HeaderBAM />
<HeaderAuthentication />
<HeaderHelpMenu />
<HeaderSystemMenu />
<HeaderAccountMenu />
Expand Down Expand Up @@ -49,7 +49,7 @@ exports[`Header Rendering Render Header component with props 1`] = `
<div
className="Header__rightSideMenu"
>
<HeaderBAM />
<HeaderAuthentication />
<HeaderHelpMenu />
<HeaderSystemMenu />
<HeaderAccountMenu />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`HeaderBAM Rendering Render HeaderBAM component with default props 1`] = `
exports[`HeaderAuthentication Rendering Render HeaderAuthentication component with default props 1`] = `
<React.Fragment>
<div
className="HeaderBAM__bam"
className="HeaderAuthentication__authentication"
>
<span>
BAM  

<SvgIcon
icon={
Object {
Expand Down Expand Up @@ -40,13 +40,13 @@ exports[`HeaderBAM Rendering Render HeaderBAM component with default props 1`] =
</React.Fragment>
`;

exports[`HeaderBAM Rendering Render HeaderBAM component with props 1`] = `
exports[`HeaderAuthentication Rendering Render HeaderAuthentication component with props 1`] = `
<React.Fragment>
<div
className="HeaderBAM__bam varClassName"
className="HeaderAuthentication__authentication varClassName"
>
<span>
BAM  

<SvgIcon
icon={
Object {
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
'\\.po$': '@bluecateng/l10n-jest',
},
transformIgnorePatterns: [
'node_modules/(?!(lodash-es|@bluecat|@bluecateng)/)',
'node_modules/(?!(lodash-es|@bluecat|@bluecateng|@carbon)/)',
],
collectCoverage: true,
coverageReporters: ['text', 'html'],
Expand Down
Loading