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]);
});
});
});