packages/popper/tests/unit/getClientRect.js
raw| 1 | import chai from 'chai'; |
| 2 | const { expect } = chai; |
| 3 | import getClientRect from '../../src/utils/getClientRect'; |
| 4 | |
| 5 | describe('utils/getClientRect', () => { |
| 6 | it('should calculate right and bottom', () => { |
| 7 | const offsets = { |
| 8 | top: 1, |
| 9 | left: 2, |
| 10 | width: 3, |
| 11 | height: 4, |
| 12 | }; |
| 13 | expect(getClientRect(offsets)).to.deep.equal({ |
| 14 | top: 1, |
| 15 | left: 2, |
| 16 | width: 3, |
| 17 | height: 4, |
| 18 | right: 5, |
| 19 | bottom: 5, |
| 20 | }); |
| 21 | }); |
| 22 | }); |