summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2019-04-12 17:59:44 +0000
committerFatih Acet <acetfatih@gmail.com>2019-04-12 17:59:44 +0000
commit44be329d59bc20598c2c2f310d4f3029c8dd25a9 (patch)
treedfc1631853166df8760b922fe2173b6c5d873ae8
parent6fbfa0607662197817dec0698362271a7b432e6d (diff)
parent9dca4f127f8fbc3c74a55c5dbd075ea3533f56b2 (diff)
downloadgitlab-ce-44be329d59bc20598c2c2f310d4f3029c8dd25a9.tar.gz
Merge branch '60369-border-radius-still-showing-up-after-improve-diff-nav-header-was-finished' into 'master'
Breakpoints.isDesktop should not always return false Closes #60369 See merge request gitlab-org/gitlab-ce!27240
-rw-r--r--app/assets/javascripts/breakpoints.js2
-rw-r--r--spec/javascripts/breakpoints_spec.js14
2 files changed, 15 insertions, 1 deletions
diff --git a/app/assets/javascripts/breakpoints.js b/app/assets/javascripts/breakpoints.js
index 4d5d6bb864b..93aacba0e8e 100644
--- a/app/assets/javascripts/breakpoints.js
+++ b/app/assets/javascripts/breakpoints.js
@@ -15,7 +15,7 @@ const BreakpointInstance = {
return breakpoint;
},
isDesktop() {
- return ['lg', 'md'].includes(this.getBreakpointSize);
+ return ['lg', 'md'].includes(this.getBreakpointSize());
},
};
diff --git a/spec/javascripts/breakpoints_spec.js b/spec/javascripts/breakpoints_spec.js
index 5ee777fee3f..fc0d9eb907a 100644
--- a/spec/javascripts/breakpoints_spec.js
+++ b/spec/javascripts/breakpoints_spec.js
@@ -10,4 +10,18 @@ describe('breakpoints', () => {
expect(bp.getBreakpointSize()).toBe(key);
});
});
+
+ describe('isDesktop', () => {
+ it('returns true when screen size is medium', () => {
+ spyOn(bp, 'windowWidth').and.returnValue(breakpoints.md + 10);
+
+ expect(bp.isDesktop()).toBe(true);
+ });
+
+ it('returns false when screen size is small', () => {
+ spyOn(bp, 'windowWidth').and.returnValue(breakpoints.sm + 10);
+
+ expect(bp.isDesktop()).toBe(false);
+ });
+ });
});