Skip to content

Commit

Permalink
chore(tests): add can-scroll tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarsiBarsi committed Oct 8, 2020
1 parent 8456e64 commit 56d6ca2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions projects/cdk/utils/dom/test/can-scroll.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {canScroll} from '../can-scroll';

describe('canScroll', () => {
it('works vertically', () => {
const parent = document.createElement('div');
const child = document.createElement('div');

parent.appendChild(child);

expect(canScroll(child, parent, true, true)).toEqual(false);
});

it('works horizontally', () => {
const parent = document.createElement('div');
const child = document.createElement('div');

parent.appendChild(child);

expect(canScroll(child, parent, false, true)).toEqual(false);
});
});

0 comments on commit 56d6ca2

Please sign in to comment.