Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-08-10 14:38:45 +0300
committerPhil Hughes <me@iamphill.com>2017-08-10 14:38:45 +0300
commit61033b2d4f7084141a6b8f45e9114ca5e86a73ce (patch)
treea8e88fdd8e41a9a65a94844d09891cf3235328b4 /spec/javascripts
parent53ee38053cb924b57447e385dee2a45b8e759ff5 (diff)
Increase performance of the breakpoint size checker
Diffstat (limited to 'spec/javascripts')
-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);
+ });
+ });
+});