diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-20 00:07:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-20 00:07:28 +0300 |
commit | 9bc3ee9ad4c857570b7a029345cc6fff3ed46b5f (patch) | |
tree | 4de11c170947a73056c72b47f1036c048e7c082e /spec/frontend/terms | |
parent | dc539af30068062bd6fc2f9c6b478d4a1feb8c23 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/terms')
-rw-r--r-- | spec/frontend/terms/components/app_spec.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/spec/frontend/terms/components/app_spec.js b/spec/frontend/terms/components/app_spec.js index ce1c126f868..99f61a31dbd 100644 --- a/spec/frontend/terms/components/app_spec.js +++ b/spec/frontend/terms/components/app_spec.js @@ -3,7 +3,6 @@ import { GlIntersectionObserver } from '@gitlab/ui'; import { nextTick } from 'vue'; import { mountExtended } from 'helpers/vue_test_utils_helper'; -import { FLASH_TYPES, FLASH_CLOSED_EVENT } from '~/flash'; import { isLoggedIn } from '~/lib/utils/common_utils'; import TermsApp from '~/terms/components/app.vue'; import { renderGFM } from '~/behaviors/markdown/render_gfm'; @@ -129,7 +128,6 @@ describe('TermsApp', () => { beforeEach(() => { flashEl = document.createElement('div'); - flashEl.classList.add(`flash-${FLASH_TYPES.ALERT}`); document.body.appendChild(flashEl); }); @@ -137,7 +135,7 @@ describe('TermsApp', () => { document.body.innerHTML = ''; }); - it('recalculates height of scrollable viewport', () => { + it('recalculates height of scrollable viewport', async () => { jest.spyOn(document.documentElement, 'scrollHeight', 'get').mockImplementation(() => 800); jest.spyOn(document.documentElement, 'clientHeight', 'get').mockImplementation(() => 600); @@ -148,7 +146,8 @@ describe('TermsApp', () => { jest.spyOn(document.documentElement, 'scrollHeight', 'get').mockImplementation(() => 700); jest.spyOn(document.documentElement, 'clientHeight', 'get').mockImplementation(() => 600); - flashEl.dispatchEvent(new Event(FLASH_CLOSED_EVENT)); + flashEl.remove(); + await nextTick(); expect(findScrollableViewport().attributes('style')).toBe('max-height: calc(100vh - 100px);'); }); |