diff options
author | Fatih Acet <acetfatih@gmail.com> | 2019-04-12 17:59:44 +0000 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-04-12 20:29:21 +0000 |
commit | 0dfbcc70c30b1ca8609ec602c5e0cd3223b567cf (patch) | |
tree | 214ca18d757f2f89f9c119a0d447ac357b452a02 | |
parent | 004307be2dc56e550885e8a66a17d57ee34341f6 (diff) | |
download | gitlab-ce-0dfbcc70c30b1ca8609ec602c5e0cd3223b567cf.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
(cherry picked from commit 44be329d59bc20598c2c2f310d4f3029c8dd25a9)
9dca4f12 Fix isDesktop function to return proper value
-rw-r--r-- | app/assets/javascripts/breakpoints.js | 2 | ||||
-rw-r--r-- | spec/javascripts/breakpoints_spec.js | 14 |
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); + }); + }); }); |