summaryrefslogtreecommitdiff
path: root/spec/javascripts/breakpoints_spec.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-08-10 12:38:45 +0100
committerPhil Hughes <me@iamphill.com>2017-08-10 12:38:45 +0100
commit61033b2d4f7084141a6b8f45e9114ca5e86a73ce (patch)
treea8e88fdd8e41a9a65a94844d09891cf3235328b4 /spec/javascripts/breakpoints_spec.js
parent53ee38053cb924b57447e385dee2a45b8e759ff5 (diff)
downloadgitlab-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.js15
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);
+ });
+ });
+});