2017-07-19 11:57:00 -04:00
|
|
|
import { calculateTop } from '~/fly_out_nav';
|
2017-07-19 05:36:08 -04:00
|
|
|
|
|
|
|
describe('Fly out sidebar navigation', () => {
|
|
|
|
describe('calculateTop', () => {
|
|
|
|
it('returns boundingRect top', () => {
|
|
|
|
const boundingRect = {
|
|
|
|
top: 100,
|
2017-07-24 11:14:29 -04:00
|
|
|
height: 100,
|
2017-07-19 05:36:08 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
expect(
|
|
|
|
calculateTop(boundingRect, 100),
|
|
|
|
).toBe(100);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('returns boundingRect - bottomOverflow', () => {
|
|
|
|
const boundingRect = {
|
2017-07-24 11:14:29 -04:00
|
|
|
top: window.innerHeight - 50,
|
|
|
|
height: 100,
|
2017-07-19 05:36:08 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
expect(
|
|
|
|
calculateTop(boundingRect, 100),
|
2017-07-24 11:14:29 -04:00
|
|
|
).toBe(window.innerHeight - 50);
|
2017-07-19 05:36:08 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|