diff options
author | Phil Hughes <me@iamphill.com> | 2017-08-10 12:38:45 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-08-10 12:38:45 +0100 |
commit | 61033b2d4f7084141a6b8f45e9114ca5e86a73ce (patch) | |
tree | a8e88fdd8e41a9a65a94844d09891cf3235328b4 /spec/javascripts/breakpoints_spec.js | |
parent | 53ee38053cb924b57447e385dee2a45b8e759ff5 (diff) | |
download | gitlab-ce-61033b2d4f7084141a6b8f45e9114ca5e86a73ce.tar.gz |
Increase performance of the breakpoint size checker
Diffstat (limited to 'spec/javascripts/breakpoints_spec.js')
-rw-r--r-- | spec/javascripts/breakpoints_spec.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/javascripts/breakpoints_spec.js b/spec/javascripts/breakpoints_spec.js new file mode 100644 index 00000000000..b1b5d36c1fb --- /dev/null +++ b/spec/javascripts/breakpoints_spec.js @@ -0,0 +1,15 @@ +import bp, { + breakpoints, +} from '~/breakpoints'; + +describe('breakpoints', () => { + Object.keys(breakpoints).forEach((key) => { + const size = breakpoints[key]; + + it(`returns ${key} when larger than ${size}`, () => { + spyOn(bp, 'windowWidth').and.returnValue(size + 10); + + expect(bp.getBreakpointSize()).toBe(key); + }); + }); +}); |