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
path: root/spec
diff options
context:
space:
mode:
authorSam Bigelow <sbigelow@gitlab.com>2019-04-10 23:39:03 +0300
committerSam Bigelow <sbigelow@gitlab.com>2019-04-12 17:47:36 +0300
commit9dca4f127f8fbc3c74a55c5dbd075ea3533f56b2 (patch)
treefd8623dc4a3b1eb71926fc667f7cda93b3a73d3f /spec
parent539ac2589966c77d50249a80c08285f1acf9c024 (diff)
Fix isDesktop function to return proper value
Diffstat (limited to 'spec')
-rw-r--r--spec/javascripts/breakpoints_spec.js14
1 files changed, 14 insertions, 0 deletions
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);
+ });
+ });
});