diff options
Diffstat (limited to 'spec/frontend/boards/components/board_content_spec.js')
-rw-r--r-- | spec/frontend/boards/components/board_content_spec.js | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/frontend/boards/components/board_content_spec.js b/spec/frontend/boards/components/board_content_spec.js index b2138700602..39b2fe2ebbf 100644 --- a/spec/frontend/boards/components/board_content_spec.js +++ b/spec/frontend/boards/components/board_content_spec.js @@ -123,15 +123,32 @@ describe('BoardContent', () => { expect(wrapper.findComponent(GlAlert).exists()).toBe(false); }); - it('resizes the list on resize', async () => { + it('on small screens, sets board container height to full height', async () => { window.innerHeight = 1000; + window.innerWidth = 767; jest.spyOn(Element.prototype, 'getBoundingClientRect').mockReturnValue({ top: 100 }); wrapper.vm.resizeObserver.trigger(); await nextTick(); - expect(wrapper.findComponent({ ref: 'list' }).attributes('style')).toBe('height: 900px;'); + const style = wrapper.findComponent({ ref: 'list' }).attributes('style'); + + expect(style).toBe('height: 1000px;'); + }); + + it('on large screens, sets board container height fill area below filters', async () => { + window.innerHeight = 1000; + window.innerWidth = 768; + jest.spyOn(Element.prototype, 'getBoundingClientRect').mockReturnValue({ top: 100 }); + + wrapper.vm.resizeObserver.trigger(); + + await nextTick(); + + const style = wrapper.findComponent({ ref: 'list' }).attributes('style'); + + expect(style).toBe('height: 900px;'); }); }); |