From 4d528bfd734a021b42f9c829831029e5515deb8f Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 17 Nov 2022 03:08:08 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../boards/components/board_content_spec.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'spec/frontend/boards/components') 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;'); }); }); -- cgit v1.2.3