diff options
-rw-r--r-- | app/components/pajamas/banner_component.html.haml | 5 | ||||
-rw-r--r-- | app/components/pajamas/banner_component.rb | 3 | ||||
-rw-r--r-- | doc/subscriptions/gitlab_dedicated/index.md | 1 | ||||
-rw-r--r-- | spec/components/pajamas/banner_component_spec.rb | 7 | ||||
-rw-r--r-- | spec/frontend/api_spec.js | 2 | ||||
-rw-r--r-- | spec/frontend/content_editor/extensions/attachment_spec.js | 9 | ||||
-rw-r--r-- | spec/frontend/diffs/components/diff_file_header_spec.js | 6 | ||||
-rw-r--r-- | spec/frontend/ide/lib/mirror_spec.js | 7 | ||||
-rw-r--r-- | spec/frontend/issues/show/components/app_spec.js | 4 | ||||
-rw-r--r-- | spec/frontend/lib/utils/axios_utils_spec.js | 2 | ||||
-rw-r--r-- | spec/frontend/lib/utils/common_utils_spec.js | 1 | ||||
-rw-r--r-- | spec/frontend/test_setup.js | 11 |
12 files changed, 31 insertions, 27 deletions
diff --git a/app/components/pajamas/banner_component.html.haml b/app/components/pajamas/banner_component.html.haml index ebb88b305dc..ce380d611a0 100644 --- a/app/components/pajamas/banner_component.html.haml +++ b/app/components/pajamas/banner_component.html.haml @@ -1,8 +1,9 @@ -# This is using gl-card classes to match Vue component -# Here's the issue to refactor away from gl-card -# https://gitlab.com/gitlab-org/gitlab-ui/-/issues/2324 + .gl-banner.gl-card.gl-pl-6.gl-pr-8.gl-py-6{ @banner_options, class: banner_class } - .gl-display-flex + .gl-card-body.gl-display-flex.gl-p-0! - if illustration? .gl-banner-illustration = illustration @@ -11,7 +12,7 @@ = image_tag @svg_path, alt: "" .gl-banner-content - %h1.gl-banner-title= title + %h2.gl-banner-title= title = content diff --git a/app/components/pajamas/banner_component.rb b/app/components/pajamas/banner_component.rb index 5291db91fb2..8624464152c 100644 --- a/app/components/pajamas/banner_component.rb +++ b/app/components/pajamas/banner_component.rb @@ -36,8 +36,9 @@ module Pajamas def banner_class classes = [] - classes.push('gl-border-none') if @embedded + classes.push('gl-bg-gray-10!') unless introduction? classes.push('gl-banner-introduction') if introduction? + classes.push('gl-border-none!') if @embedded classes.join(' ') end diff --git a/doc/subscriptions/gitlab_dedicated/index.md b/doc/subscriptions/gitlab_dedicated/index.md index 07abfb223ef..4544124176e 100644 --- a/doc/subscriptions/gitlab_dedicated/index.md +++ b/doc/subscriptions/gitlab_dedicated/index.md @@ -120,7 +120,6 @@ The following GitLab application features are not available: - LDAP, Smartcard, or Kerberos authentication - Multiple login providers -- Advanced search - GitLab Pages - FortiAuthenticator, or FortiToken 2FA - Reply-by email diff --git a/spec/components/pajamas/banner_component_spec.rb b/spec/components/pajamas/banner_component_spec.rb index 47dc9042913..95744375c52 100644 --- a/spec/components/pajamas/banner_component_spec.rb +++ b/spec/components/pajamas/banner_component_spec.rb @@ -23,7 +23,7 @@ RSpec.describe Pajamas::BannerComponent, type: :component do end it 'renders its title' do - expect(page).to have_css "h1[class='gl-banner-title']", text: title + expect(page).to have_css "h2[class='gl-banner-title']", text: title end it 'renders a close button' do @@ -65,7 +65,7 @@ RSpec.describe Pajamas::BannerComponent, type: :component do describe 'embedded' do context 'by default (false)' do it 'keeps the banner\'s borders' do - expect(page).not_to have_css ".gl-banner.gl-border-none" + expect(page).not_to have_css ".gl-banner.gl-border-none\\!" end end @@ -73,7 +73,7 @@ RSpec.describe Pajamas::BannerComponent, type: :component do let(:options) { { embedded: true } } it 'removes the banner\'s borders' do - expect(page).to have_css ".gl-banner.gl-border-none" + expect(page).to have_css ".gl-banner.gl-border-none\\!" end end end @@ -82,6 +82,7 @@ RSpec.describe Pajamas::BannerComponent, type: :component do context 'by default (promotion)' do it 'does not apply introduction class' do expect(page).not_to have_css ".gl-banner-introduction" + expect(page).to have_css ".gl-banner.gl-bg-gray-10\\!" end end diff --git a/spec/frontend/api_spec.js b/spec/frontend/api_spec.js index e0e5cc2c031..3a000a01cdc 100644 --- a/spec/frontend/api_spec.js +++ b/spec/frontend/api_spec.js @@ -736,7 +736,7 @@ describe('Api', () => { it('rejects the Promise', () => { mock.onGet(expectedUrl).replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR); - return Api.issueTemplates(namespace, project, templateType, () => { + Api.issueTemplates(namespace, project, templateType, () => { expect(mock.history.get).toHaveLength(1); }); }); diff --git a/spec/frontend/content_editor/extensions/attachment_spec.js b/spec/frontend/content_editor/extensions/attachment_spec.js index c7d987d016e..f037ac520fe 100644 --- a/spec/frontend/content_editor/extensions/attachment_spec.js +++ b/spec/frontend/content_editor/extensions/attachment_spec.js @@ -300,12 +300,9 @@ describe('content_editor/extensions/attachment', () => { it('emits an alert event that includes an error message', () => { tiptapEditor.commands.uploadAttachment({ file: attachmentFile }); - return new Promise((resolve) => { - eventHub.$on('alert', ({ message, variant }) => { - expect(variant).toBe(VARIANT_DANGER); - expect(message).toBe('An error occurred while uploading the file. Please try again.'); - resolve(); - }); + eventHub.$on('alert', ({ message, variant }) => { + expect(variant).toBe(VARIANT_DANGER); + expect(message).toBe('An error occurred while uploading the file. Please try again.'); }); }); }); diff --git a/spec/frontend/diffs/components/diff_file_header_spec.js b/spec/frontend/diffs/components/diff_file_header_spec.js index 4e6ed88f268..d6539a5bffa 100644 --- a/spec/frontend/diffs/components/diff_file_header_spec.js +++ b/spec/frontend/diffs/components/diff_file_header_spec.js @@ -662,7 +662,7 @@ describe('DiffFileHeader component', () => { }, ); - it('removes the property that forces a file to be shown when the file review is toggled', async () => { + it('removes the property that forces a file to be shown when the file review is toggled', () => { createComponent({ props: { diffFile: { @@ -681,7 +681,7 @@ describe('DiffFileHeader component', () => { findReviewFileCheckbox().vm.$emit('change', true); - await testAction( + testAction( setFileForcedOpen, { filePath: diffFile.file_path, forced: false }, {}, @@ -691,7 +691,7 @@ describe('DiffFileHeader component', () => { findReviewFileCheckbox().vm.$emit('change', false); - await testAction( + testAction( setFileForcedOpen, { filePath: diffFile.file_path, forced: false }, {}, diff --git a/spec/frontend/ide/lib/mirror_spec.js b/spec/frontend/ide/lib/mirror_spec.js index 1c44f4588d5..98e6b0deee6 100644 --- a/spec/frontend/ide/lib/mirror_spec.js +++ b/spec/frontend/ide/lib/mirror_spec.js @@ -97,11 +97,10 @@ describe('ide/lib/mirror', () => { connection = mirror.connect(TEST_PATH); }); - afterEach(() => { - mirror.disconnect(); - }); - it('waits before creating web socket', () => { + // ignore error when test suite terminates + connection.catch(() => {}); + return waitForConnection(SERVICE_DELAY - 10).then(() => { expect(global.WebSocket).not.toHaveBeenCalled(); }); diff --git a/spec/frontend/issues/show/components/app_spec.js b/spec/frontend/issues/show/components/app_spec.js index e4294adb9d5..f9ce7c20ad6 100644 --- a/spec/frontend/issues/show/components/app_spec.js +++ b/spec/frontend/issues/show/components/app_spec.js @@ -96,10 +96,6 @@ describe('Issuable output', () => { afterEach(() => { document.body.classList?.remove('issuable-sticky-header-visible'); - - // Consume any pending requests - jest.advanceTimersToNextTimer(); - return waitForPromises(); }); describe('update', () => { diff --git a/spec/frontend/lib/utils/axios_utils_spec.js b/spec/frontend/lib/utils/axios_utils_spec.js index 4502d56c058..2656fb1d648 100644 --- a/spec/frontend/lib/utils/axios_utils_spec.js +++ b/spec/frontend/lib/utils/axios_utils_spec.js @@ -38,7 +38,7 @@ describe('axios_utils', () => { it('waits for requests on a specific URL', () => { const handler = jest.fn(); axios.get('/ok').finally(handler); - axios.waitFor('/err').catch(() => { + axios.waitFor('/err').finally(() => { throw new Error('waitFor on /err should not be called'); }); return axios.waitFor('/ok'); diff --git a/spec/frontend/lib/utils/common_utils_spec.js b/spec/frontend/lib/utils/common_utils_spec.js index d2ddd28444a..6295914b127 100644 --- a/spec/frontend/lib/utils/common_utils_spec.js +++ b/spec/frontend/lib/utils/common_utils_spec.js @@ -58,7 +58,6 @@ describe('common_utils', () => { afterEach(() => { window.history.pushState({}, null, ''); - jest.runAllTimers(); }); function expectGetElementIdToHaveBeenCalledWith(elementId) { diff --git a/spec/frontend/test_setup.js b/spec/frontend/test_setup.js index 6e61116570b..d3d3e5c8c72 100644 --- a/spec/frontend/test_setup.js +++ b/spec/frontend/test_setup.js @@ -1,4 +1,6 @@ /* Setup for unit test environment */ +// eslint-disable-next-line no-restricted-syntax +import { setImmediate } from 'timers'; import Dexie from 'dexie'; import { IDBKeyRange, IDBFactory } from 'fake-indexeddb'; import 'helpers/shared_test_setup'; @@ -8,6 +10,15 @@ const indexedDB = new IDBFactory(); Dexie.dependencies.indexedDB = indexedDB; Dexie.dependencies.IDBKeyRange = IDBKeyRange; +afterEach(() => + // give Promises a bit more time so they fail the right test + // eslint-disable-next-line no-restricted-syntax + new Promise(setImmediate).then(() => { + // wait for pending setTimeout()s + jest.runOnlyPendingTimers(); + }), +); + afterEach(async () => { const dbs = await indexedDB.databases(); |