| Total Complexity | 3 |
| Complexity/F | 1 |
| Lines of Code | 33 |
| Function Count | 3 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | import expect from 'expect'; |
||
| 2 | import { |
||
| 3 | getEditorTop, |
||
| 4 | OFFSET |
||
| 5 | } from './../../src/util/getEditorTop'; |
||
| 6 | |||
| 7 | describe('getEditorTop utility function', () => { |
||
| 8 | |||
| 9 | it('Should return null if no node is passed', () => { |
||
| 10 | |||
| 11 | const rowElement = null; |
||
| 12 | |||
| 13 | expect(getEditorTop(rowElement)) |
||
| 14 | .toEqual(null); |
||
| 15 | |||
| 16 | }); |
||
| 17 | |||
| 18 | it('Should return top if a node is passed', () => { |
||
| 19 | |||
| 20 | const rowElement = { |
||
| 21 | offsetTop: 30, |
||
| 22 | clientHeight: 100 |
||
| 23 | }; |
||
| 24 | |||
| 25 | expect(getEditorTop(rowElement)) |
||
| 26 | .toEqual(rowElement.offsetTop |
||
| 27 | + rowElement.clientHeight |
||
| 28 | + OFFSET |
||
| 29 | ); |
||
| 30 | |||
| 31 | }); |
||
| 32 | |||
| 33 | }); |
||
| 34 |