Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('Arrow placement', () => {
const arrowClasses = {
[POPPER_PLACEMENTS.LEFT]: 'c-arrow--r',
[POPPER_PLACEMENTS.LEFT_START]: 'c-arrow--rt',
[POPPER_PLACEMENTS.LEFT_END]: 'c-arrow--rb',
[POPPER_PLACEMENTS.TOP]: 'c-arrow--b',
[POPPER_PLACEMENTS.TOP_START]: 'c-arrow--bl',
[POPPER_PLACEMENTS.TOP_END]: 'c-arrow--br',
[POPPER_PLACEMENTS.RIGHT]: 'c-arrow--l',
[POPPER_PLACEMENTS.RIGHT_START]: 'c-arrow--lt',
[POPPER_PLACEMENTS.RIGHT_END]: 'c-arrow--lb',
[POPPER_PLACEMENTS.BOTTOM]: 'c-arrow--t',
[POPPER_PLACEMENTS.BOTTOM_START]: 'c-arrow--tl',
[POPPER_PLACEMENTS.BOTTOM_END]: 'c-arrow--tr'
};
it('renders correct arrow placement if provided', () => {
Object.keys(arrowClasses).forEach(placement => {
const { container } = render();
expect(container.firstChild.firstChild).toHaveClass(arrowClasses[placement]);
});
});
});
it('renders down styling if placement is provided', () => {
[
POPPER_PLACEMENTS.BOTTOM,
POPPER_PLACEMENTS.BOTTOM_START,
POPPER_PLACEMENTS.BOTTOM_END
].forEach(placement => {
const { container } = render();
expect(container.firstChild.firstChild).toHaveClass('c-menu--down');
});
});
describe('Arrow placement', () => {
const arrowClasses = {
[POPPER_PLACEMENTS.LEFT]: 'c-arrow--r',
[POPPER_PLACEMENTS.LEFT_START]: 'c-arrow--rt',
[POPPER_PLACEMENTS.LEFT_END]: 'c-arrow--rb',
[POPPER_PLACEMENTS.TOP]: 'c-arrow--b',
[POPPER_PLACEMENTS.TOP_START]: 'c-arrow--bl',
[POPPER_PLACEMENTS.TOP_END]: 'c-arrow--br',
[POPPER_PLACEMENTS.RIGHT]: 'c-arrow--l',
[POPPER_PLACEMENTS.RIGHT_START]: 'c-arrow--lt',
[POPPER_PLACEMENTS.RIGHT_END]: 'c-arrow--lb',
[POPPER_PLACEMENTS.BOTTOM]: 'c-arrow--t',
[POPPER_PLACEMENTS.BOTTOM_START]: 'c-arrow--tl',
[POPPER_PLACEMENTS.BOTTOM_END]: 'c-arrow--tr'
};
it('renders correct arrow placement if provided', () => {
Object.keys(arrowClasses).forEach(placement => {
const { container } = render();
expect(container.firstChild.firstChild).toHaveClass(arrowClasses[placement]);
});
});
});
it('renders left styling if placement is provided', () => {
[POPPER_PLACEMENTS.LEFT, POPPER_PLACEMENTS.LEFT_START, POPPER_PLACEMENTS.LEFT_END].forEach(
placement => {
const { container } = render();
expect(container.firstChild.firstChild).toHaveClass('c-menu--left');
}
);
});
describe('Arrow placement', () => {
const arrowClasses = {
[POPPER_PLACEMENTS.LEFT]: 'c-arrow--r',
[POPPER_PLACEMENTS.LEFT_START]: 'c-arrow--rt',
[POPPER_PLACEMENTS.LEFT_END]: 'c-arrow--rb',
[POPPER_PLACEMENTS.TOP]: 'c-arrow--b',
[POPPER_PLACEMENTS.TOP_START]: 'c-arrow--bl',
[POPPER_PLACEMENTS.TOP_END]: 'c-arrow--br',
[POPPER_PLACEMENTS.RIGHT]: 'c-arrow--l',
[POPPER_PLACEMENTS.RIGHT_START]: 'c-arrow--lt',
[POPPER_PLACEMENTS.RIGHT_END]: 'c-arrow--lb',
[POPPER_PLACEMENTS.BOTTOM]: 'c-arrow--t',
[POPPER_PLACEMENTS.BOTTOM_START]: 'c-arrow--tl',
[POPPER_PLACEMENTS.BOTTOM_END]: 'c-arrow--tr'
};
it('renders correct arrow placement if provided', () => {
Object.keys(arrowClasses).forEach(placement => {
const { container } = render();
expect(container.firstChild.firstChild).toHaveClass(arrowClasses[placement]);
describe('Arrow placement', () => {
const arrowClasses = {
[POPPER_PLACEMENTS.LEFT]: 'c-arrow--r',
[POPPER_PLACEMENTS.LEFT_START]: 'c-arrow--rt',
[POPPER_PLACEMENTS.LEFT_END]: 'c-arrow--rb',
[POPPER_PLACEMENTS.TOP]: 'c-arrow--b',
[POPPER_PLACEMENTS.TOP_START]: 'c-arrow--bl',
[POPPER_PLACEMENTS.TOP_END]: 'c-arrow--br',
[POPPER_PLACEMENTS.RIGHT]: 'c-arrow--l',
[POPPER_PLACEMENTS.RIGHT_START]: 'c-arrow--lt',
[POPPER_PLACEMENTS.RIGHT_END]: 'c-arrow--lb',
[POPPER_PLACEMENTS.BOTTOM]: 'c-arrow--t',
[POPPER_PLACEMENTS.BOTTOM_START]: 'c-arrow--tl',
[POPPER_PLACEMENTS.BOTTOM_END]: 'c-arrow--tr'
};
it('renders correct arrow placement if provided', () => {
Object.keys(arrowClasses).forEach(placement => {
const { container } = render();
describe('Arrow placement', () => {
const arrowClasses = {
[POPPER_PLACEMENTS.LEFT]: 'c-arrow--r',
[POPPER_PLACEMENTS.LEFT_START]: 'c-arrow--rt',
[POPPER_PLACEMENTS.LEFT_END]: 'c-arrow--rb',
[POPPER_PLACEMENTS.TOP]: 'c-arrow--b',
[POPPER_PLACEMENTS.TOP_START]: 'c-arrow--bl',
[POPPER_PLACEMENTS.TOP_END]: 'c-arrow--br',
[POPPER_PLACEMENTS.RIGHT]: 'c-arrow--l',
[POPPER_PLACEMENTS.RIGHT_START]: 'c-arrow--lt',
[POPPER_PLACEMENTS.RIGHT_END]: 'c-arrow--lb',
[POPPER_PLACEMENTS.BOTTOM]: 'c-arrow--t',
[POPPER_PLACEMENTS.BOTTOM_START]: 'c-arrow--tl',
[POPPER_PLACEMENTS.BOTTOM_END]: 'c-arrow--tr'
};
it('renders correct arrow placement if provided', () => {
Object.keys(arrowClasses).forEach(placement => {
const { container } = render();
expect(container.firstChild.firstChild).toHaveClass(arrowClasses[placement]);
});
});
});
describe('Arrow placement', () => {
const arrowClasses = {
[POPPER_PLACEMENTS.LEFT]: 'c-arrow--r',
[POPPER_PLACEMENTS.LEFT_START]: 'c-arrow--rt',
[POPPER_PLACEMENTS.LEFT_END]: 'c-arrow--rb',
[POPPER_PLACEMENTS.TOP]: 'c-arrow--b',
[POPPER_PLACEMENTS.TOP_START]: 'c-arrow--bl',
[POPPER_PLACEMENTS.TOP_END]: 'c-arrow--br',
[POPPER_PLACEMENTS.RIGHT]: 'c-arrow--l',
[POPPER_PLACEMENTS.RIGHT_START]: 'c-arrow--lt',
[POPPER_PLACEMENTS.RIGHT_END]: 'c-arrow--lb',
[POPPER_PLACEMENTS.BOTTOM]: 'c-arrow--t',
[POPPER_PLACEMENTS.BOTTOM_START]: 'c-arrow--tl',
[POPPER_PLACEMENTS.BOTTOM_END]: 'c-arrow--tr'
};
it('renders correct arrow placement if provided', () => {
Object.keys(arrowClasses).forEach(placement => {
const { container } = render();
expect(container.firstChild.firstChild).toHaveClass(arrowClasses[placement]);
});
});
});
describe('Arrow placement', () => {
const arrowClasses = {
[POPPER_PLACEMENTS.LEFT]: 'c-arrow--r',
[POPPER_PLACEMENTS.LEFT_START]: 'c-arrow--rt',
[POPPER_PLACEMENTS.LEFT_END]: 'c-arrow--rb',
[POPPER_PLACEMENTS.TOP]: 'c-arrow--b',
[POPPER_PLACEMENTS.TOP_START]: 'c-arrow--bl',
[POPPER_PLACEMENTS.TOP_END]: 'c-arrow--br',
[POPPER_PLACEMENTS.RIGHT]: 'c-arrow--l',
[POPPER_PLACEMENTS.RIGHT_START]: 'c-arrow--lt',
[POPPER_PLACEMENTS.RIGHT_END]: 'c-arrow--lb',
[POPPER_PLACEMENTS.BOTTOM]: 'c-arrow--t',
[POPPER_PLACEMENTS.BOTTOM_START]: 'c-arrow--tl',
[POPPER_PLACEMENTS.BOTTOM_END]: 'c-arrow--tr'
};
it('renders correct arrow placement if provided', () => {
Object.keys(arrowClasses).forEach(placement => {
const { container } = render();
expect(container.firstChild.firstChild).toHaveClass(arrowClasses[placement]);
});
});
});
it('renders up styling if placement is provided', () => {
[POPPER_PLACEMENTS.TOP, POPPER_PLACEMENTS.TOP_START, POPPER_PLACEMENTS.TOP_END].forEach(
placement => {
const { container } = render();
expect(container.firstChild.firstChild).toHaveClass('c-menu--up');
}
);
});