Repository URL to install this package:
|
Version:
8.1.0-rc.5 ▾
|
import React from 'react';
import { shallow } from 'enzyme';
import Menu from './Menu';
describe('Test Menu', () => {
describe('Test menu position', () => {
it('should be at bottom by default', () => {
const entries = [
{
label: 'Test',
icon: 'target',
},
];
const wrapper = shallow(
<Menu items={entries}>
<span>child</span>
</Menu>
);
expect(
wrapper
.childAt(1)
.props()
.className.indexOf('Menu-list--position-bottom')
).not.toBe(-1);
});
it('should be at top if top position is passed', () => {
const entries = [
{
label: 'Test',
target: 'target',
},
];
const wrapper = shallow(
<Menu items={entries} position="top">
<span>child</span>
</Menu>
);
expect(
wrapper
.childAt(1)
.props()
.className.indexOf('Menu-list--position-top')
).not.toBe(-1);
});
});
});