Skip to content
Snippets Groups Projects
Commit 0dfbcc70 authored by Fatih Acet's avatar Fatih Acet Committed by GitLab Release Tools Bot
Browse files

Merge branch...

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 44be329d)

9dca4f12 Fix isDesktop function to return proper value
parent 004307be
No related merge requests found
...@@ -15,7 +15,7 @@ const BreakpointInstance = { ...@@ -15,7 +15,7 @@ const BreakpointInstance = {
return breakpoint; return breakpoint;
}, },
isDesktop() { isDesktop() {
return ['lg', 'md'].includes(this.getBreakpointSize); return ['lg', 'md'].includes(this.getBreakpointSize());
}, },
}; };
......
...@@ -10,4 +10,18 @@ describe('breakpoints', () => { ...@@ -10,4 +10,18 @@ describe('breakpoints', () => {
expect(bp.getBreakpointSize()).toBe(key); 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);
});
});
}); });
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment