gitlab-org--gitlab-foss/spec/javascripts/fly_out_nav_spec.js

28 lines
599 B
JavaScript
Raw Normal View History

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