packages/popper/tests/unit/clockwise.js
raw| 1 | import clockwise from '../../src/utils/clockwise'; |
| 2 | |
| 3 | describe('utils/clockwise', () => { |
| 4 | it('returns a clockwise ordered list of placements', () => { |
| 5 | const arr = clockwise('bottom'); |
| 6 | expect(arr[0]).toBe('bottom-start'); |
| 7 | expect(arr.slice(-1)[0]).toBe('bottom-end'); |
| 8 | }); |
| 9 | |
| 10 | it('returns a counterclockwise ordered list of placements', () => { |
| 11 | const arr = clockwise('bottom', true); |
| 12 | expect(arr[0]).toBe('bottom-end'); |
| 13 | expect(arr.slice(-1)[0]).toBe('bottom-start'); |
| 14 | }); |
| 15 | }); |