diff options
91 files changed, 430 insertions, 131 deletions
@@ -205,7 +205,7 @@ gem 'asciidoctor-plantuml', '~> 0.0.16' gem 'asciidoctor-kroki', '~> 0.7.0', require: false gem 'rouge', '~> 3.30.0' gem 'truncato', '~> 0.7.12' -gem 'nokogiri', '~> 1.14.1' +gem 'nokogiri', '~> 1.14.2' # Calendar rendering gem 'icalendar' diff --git a/Gemfile.checksum b/Gemfile.checksum index 4c2ffae4949..2dbcae42f0f 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -368,17 +368,17 @@ {"name":"nio4r","version":"2.5.8","platform":"java","checksum":"b2b1800f6bf7ce4b797ca8b639ad278a99c9c904fb087a91d944f38e4bd71401"}, {"name":"nio4r","version":"2.5.8","platform":"ruby","checksum":"3becb4ad95ab8ac0a9bd2e1b16466869402be62848082bf6329ae9091f276676"}, {"name":"no_proxy_fix","version":"0.1.2","platform":"ruby","checksum":"4e9b4c31bb146de7fcf347dc1087bb13ac2039b56d50aa019e61036256abcd00"}, -{"name":"nokogiri","version":"1.14.1","platform":"aarch64-linux","checksum":"99594e8b94f576644ac640a223d74c79e840218948e963aa635f0254927bff10"}, -{"name":"nokogiri","version":"1.14.1","platform":"arm-linux","checksum":"1dc9b7821e1fa1f3fda40659662e51a4b3692acc4ee6342ee34a6a537fc1d5d8"}, -{"name":"nokogiri","version":"1.14.1","platform":"arm64-darwin","checksum":"1a693df86da8c4c97b01d614470f9c3e10b9c755de8803fbfcfffe0f9dff522a"}, -{"name":"nokogiri","version":"1.14.1","platform":"java","checksum":"c1f87a8f7bc56028deb2aecbb29e9b318405f7c468b29047aede78b41bc735a2"}, -{"name":"nokogiri","version":"1.14.1","platform":"ruby","checksum":"b2db3af7769c29cd77d5f39cd3d0b65ab10975bdecf04be71d683f9c9abe2663"}, -{"name":"nokogiri","version":"1.14.1","platform":"x64-mingw-ucrt","checksum":"2463a1ae0be5f06a10f3f3b374c2b743bff6280db993d488511a19bb7bc7cb7c"}, -{"name":"nokogiri","version":"1.14.1","platform":"x64-mingw32","checksum":"f3a2b0ceedf51d776b39dc759ce191a4df842d7d4f5900c64f33d4753db39877"}, -{"name":"nokogiri","version":"1.14.1","platform":"x86-linux","checksum":"f395d6c28c822b0877cfb0c71781f05243c034b4823359ab25b3288a73b9fc82"}, -{"name":"nokogiri","version":"1.14.1","platform":"x86-mingw32","checksum":"be34b32fe74e82bffca5b1f3df8727c8fdc828762b6dddab53a11cd8f8515785"}, -{"name":"nokogiri","version":"1.14.1","platform":"x86_64-darwin","checksum":"9b14091f77086c4f0f09451ba3acd1b5f7e0076fb34fc536682170fa9f1a5074"}, -{"name":"nokogiri","version":"1.14.1","platform":"x86_64-linux","checksum":"21d234c51582b292e2e1e02e6c30eea9188894348985d6910aa8e993749c0aff"}, +{"name":"nokogiri","version":"1.14.2","platform":"aarch64-linux","checksum":"966acf4f6c1fba10518f86498141cf44265564ac5a65dcc8496b65f8c354f776"}, +{"name":"nokogiri","version":"1.14.2","platform":"arm-linux","checksum":"8a3a35cadae4a800ddc0b967394257343d62196d9d059b54e38cf067981db428"}, +{"name":"nokogiri","version":"1.14.2","platform":"arm64-darwin","checksum":"81404cd014ecb597725c3847523c2ee365191a968d0b5f7d857e03f388c57631"}, +{"name":"nokogiri","version":"1.14.2","platform":"java","checksum":"0a39222af14e75eb0243e8d969345e03b90c0e02b0f33c61f1ebb6ae53538bb5"}, +{"name":"nokogiri","version":"1.14.2","platform":"ruby","checksum":"c765a74aac6cf430a710bb0b6038b8ee11f177393cd6ae8dadc7a44a6e2658b6"}, +{"name":"nokogiri","version":"1.14.2","platform":"x64-mingw-ucrt","checksum":"62a18f9213a0ceeaf563d1bc7ccfd93273323c4356ded58a5617c59bc4635bc5"}, +{"name":"nokogiri","version":"1.14.2","platform":"x64-mingw32","checksum":"54f6ac2c15a7a88f431bb5e23f4616aa8fc97a92eb63336bcf65b7050f2d3be0"}, +{"name":"nokogiri","version":"1.14.2","platform":"x86-linux","checksum":"c42fa0856f01f901954898e28c3c2b4dce0e843056b1b126f441d06e887e1b77"}, +{"name":"nokogiri","version":"1.14.2","platform":"x86-mingw32","checksum":"f940d9c8e47b0f19875465376f2d1c8911bc9489ac9a48c124579819dc4a7f19"}, +{"name":"nokogiri","version":"1.14.2","platform":"x86_64-darwin","checksum":"2508978f5ca28944919973f6300f0a7355fbe72604ab6a6913f1630be1030265"}, +{"name":"nokogiri","version":"1.14.2","platform":"x86_64-linux","checksum":"bc6405e1f3ddac6e401f82d775f1c0c24c6e58c371b3fadaca0596d5d511e476"}, {"name":"notiffany","version":"0.1.3","platform":"ruby","checksum":"d37669605b7f8dcb04e004e6373e2a780b98c776f8eb503ac9578557d7808738"}, {"name":"numerizer","version":"0.2.0","platform":"ruby","checksum":"e58076d5ee5370417b7e52d9cb25836d62acd1b8d9a194c308707986c1705d7b"}, {"name":"oauth","version":"0.5.6","platform":"ruby","checksum":"4085fe28e0c5e2434135e00a6555294fd2a4ff96a98d1bdecdcd619fc6368dff"}, diff --git a/Gemfile.lock b/Gemfile.lock index a9b48ca82e7..a3d6dc31fb6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -951,7 +951,7 @@ GEM netrc (0.11.0) nio4r (2.5.8) no_proxy_fix (0.1.2) - nokogiri (1.14.1) + nokogiri (1.14.2) mini_portile2 (~> 2.8.0) racc (~> 1.4) notiffany (0.1.3) @@ -1758,7 +1758,7 @@ DEPENDENCIES multi_json (~> 1.14.1) net-ldap (~> 0.17.1) net-ntp - nokogiri (~> 1.14.1) + nokogiri (~> 1.14.2) oauth2 (~> 2.0) octokit (~> 4.15) ohai (~> 16.10) diff --git a/app/assets/javascripts/super_sidebar/components/user_bar.vue b/app/assets/javascripts/super_sidebar/components/user_bar.vue index 04499b2edce..a03d9a65e5f 100644 --- a/app/assets/javascripts/super_sidebar/components/user_bar.vue +++ b/app/assets/javascripts/super_sidebar/components/user_bar.vue @@ -1,5 +1,5 @@ <script> -import { GlButton, GlIcon, GlTooltipDirective } from '@gitlab/ui'; +import { GlButton, GlTooltipDirective } from '@gitlab/ui'; import { __ } from '~/locale'; import SafeHtml from '~/vue_shared/directives/safe_html'; import logo from '../../../../views/shared/_logo.svg'; @@ -12,10 +12,9 @@ import UserMenu from './user_menu.vue'; export default { logo, components: { - GlButton, - GlIcon, - CreateMenu, Counter, + CreateMenu, + GlButton, MergeRequestMenu, UserMenu, }, @@ -24,6 +23,7 @@ export default { createNew: __('Create new...'), issues: __('Issues'), mergeRequests: __('Merge requests'), + search: __('Search'), todoList: __('To-Do list'), }, directives: { @@ -59,9 +59,12 @@ export default { @click="collapseSidebar" /> <create-menu :groups="sidebarData.create_new_menu_groups" /> - <button class="gl-border-none"> - <gl-icon name="search" class="gl-vertical-align-middle" /> - </button> + <gl-button + icon="search" + :aria-label="$options.i18n.search" + category="tertiary" + href="/search" + /> <user-menu :data="sidebarData" /> </div> <div class="gl-display-flex gl-justify-content-space-between gl-px-3 gl-py-2 gl-gap-2"> diff --git a/app/models/bulk_import.rb b/app/models/bulk_import.rb index 2565ad5f2b8..c2d7529f468 100644 --- a/app/models/bulk_import.rb +++ b/app/models/bulk_import.rb @@ -42,6 +42,12 @@ class BulkImport < ApplicationRecord event :fail_op do transition any => :failed end + + # rubocop:disable Style/SymbolProc + after_transition any => [:finished, :failed, :timeout] do |bulk_import| + bulk_import.update_has_failures + end + # rubocop:enable Style/SymbolProc end def source_version_info @@ -55,4 +61,11 @@ class BulkImport < ApplicationRecord def self.all_human_statuses state_machine.states.map(&:human_name) end + + def update_has_failures + return if has_failures + return unless entities.any?(&:has_failures) + + update!(has_failures: true) + end end diff --git a/app/models/bulk_imports/entity.rb b/app/models/bulk_imports/entity.rb index 6fc24c77f1d..66e6d92f2ed 100644 --- a/app/models/bulk_imports/entity.rb +++ b/app/models/bulk_imports/entity.rb @@ -104,6 +104,12 @@ class BulkImports::Entity < ApplicationRecord transition created: :timeout transition started: :timeout end + + # rubocop:disable Style/SymbolProc + after_transition any => [:finished, :failed, :timeout] do |entity| + entity.update_has_failures + end + # rubocop:enable Style/SymbolProc end def self.all_human_statuses @@ -185,6 +191,13 @@ class BulkImports::Entity < ApplicationRecord default_project_visibility end + def update_has_failures + return if has_failures + return unless failures.any? + + update!(has_failures: true) + end + private def validate_parent_is_a_group diff --git a/doc/ci/environments/index.md b/doc/ci/environments/index.md index 77c4ae31f0b..4b86fdf87e8 100644 --- a/doc/ci/environments/index.md +++ b/doc/ci/environments/index.md @@ -159,6 +159,19 @@ deploy_review_app: - main ``` +### Rename an environment + +> - Renaming an environment by using the UI was [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68550) in GitLab 14.3. +> - Renaming an environment by using the API was [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/338897) in GitLab 15.9 and is planned for removal in GitLab 16.0. + +You cannot rename an environment by using the UI, and the API method was deprecated in GitLab 15.9. + +To achieve the same result as renaming an environment: + +1. [Stop the existing environment](#stop-an-environment-through-the-ui). +1. [Delete the existing environment](#delete-an-environment). +1. [Create a new environment](#create-a-static-environment) with the desired name. + ## Deployment tier of environments > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/300741) in GitLab 13.10. @@ -991,19 +1004,6 @@ like [Review Apps](../review_apps/index.md) (`review/*`). The most specific spec takes precedence over the other wildcard matching. In this case, the `review/feature-1` spec takes precedence over `review/*` and `*` specs. -### Rename an environment - -> Renaming environments through the UI was [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68550) in GitLab 14.3. Renaming environments through the API was deprecated and [is planned to be removed](https://gitlab.com/gitlab-org/gitlab/-/issues/338897) in GitLab 15.0. - -Renaming an environment through the UI is not possible. -Instead, you need to delete the old environment and create a new one: - -1. On the top bar, select **Main menu > Projects** and find your project. -1. On the left sidebar, select **Deployments > Environments**. -1. Find the environment and stop it. -1. Delete the environment. -1. Create a new environment with your preferred name. - ## Related topics - [Use GitLab CI to deploy to multiple environments (blog post)](https://about.gitlab.com/blog/2021/02/05/ci-deployment-and-environments/) diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 08990452cb0..7ca8f915895 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -16240,6 +16240,9 @@ msgstr "" msgid "Error creating new iteration" msgstr "" +msgid "Error creating or updating PreScanVerificationStep: %{errors}" +msgstr "" + msgid "Error creating repository for snippet with id %{snippet_id}" msgstr "" diff --git a/qa/qa/specs/helpers/context_selector.rb b/qa/qa/specs/helpers/context_selector.rb index dfb00cb807b..59ab7c9722e 100644 --- a/qa/qa/specs/helpers/context_selector.rb +++ b/qa/qa/specs/helpers/context_selector.rb @@ -22,7 +22,7 @@ module QA opts = {} opts[:domain] = '.+' - opts[:tld] = '.com' + opts[:tld] = opts_tld uri = URI(Runtime::Scenario.gitlab_address) @@ -79,6 +79,10 @@ module QA def production_domain GitlabEdition.jh? ? 'jihulab' : 'gitlab' end + + def opts_tld + GitlabEdition.jh? ? '(.com|.hk)' : '.com' + end end end end diff --git a/qa/spec/specs/helpers/context_selector_spec.rb b/qa/spec/specs/helpers/context_selector_spec.rb index 7541bb45d82..9e46933542e 100644 --- a/qa/spec/specs/helpers/context_selector_spec.rb +++ b/qa/spec/specs/helpers/context_selector_spec.rb @@ -43,6 +43,7 @@ RSpec.describe QA::Specs::Helpers::ContextSelector do end it 'matches multiple subdomains' do + allow(GitlabEdition).to receive(:jh?).and_return(false) QA::Runtime::Scenario.define(:gitlab_address, "https://staging.gitlab.com") aggregate_failures do @@ -51,13 +52,35 @@ RSpec.describe QA::Specs::Helpers::ContextSelector do end end + it 'matches multiple subdomains on jh side' do + allow(GitlabEdition).to receive(:jh?).and_return(true) + QA::Runtime::Scenario.define(:gitlab_address, "https://staging.jihulab.com") + + aggregate_failures do + expect(described_class.context_matches?(subdomain: [:release, :staging])).to be_truthy + expect(described_class.context_matches?(:production, subdomain: [:release, :staging])).to be_truthy + end + end + it 'matches :production' do + allow(GitlabEdition).to receive(:jh?).and_return(false) QA::Runtime::Scenario.define(:gitlab_address, "https://gitlab.com/") expect(described_class.context_matches?(:production)).to be_truthy end + it 'matches :production on jh side' do + allow(GitlabEdition).to receive(:jh?).and_return(true) + + QA::Runtime::Scenario.define(:gitlab_address, "https://jihulab.com/") + expect(described_class.context_matches?(:production)).to be_truthy + + QA::Runtime::Scenario.define(:gitlab_address, "https://jihulab.hk/") + expect(described_class.context_matches?(:production)).to be_truthy + end + it 'matches domain' do + allow(GitlabEdition).to receive(:jh?).and_return(false) QA::Runtime::Scenario.define(:gitlab_address, 'https://jihulab.com') aggregate_failures do @@ -67,6 +90,26 @@ RSpec.describe QA::Specs::Helpers::ContextSelector do end end + it 'matches domain on jh side' do + # To simulate run tests in JH + allow(GitlabEdition).to receive(:jh?).and_return(true) + QA::Runtime::Scenario.define(:gitlab_address, 'https://jihulab.com') + + aggregate_failures do + expect(described_class.context_matches?(:production)).to be_truthy + expect(described_class.context_matches?(domain: 'gitlab')).to be_falsey + expect(described_class.context_matches?(domain: 'jihulab')).to be_truthy + end + + QA::Runtime::Scenario.define(:gitlab_address, 'https://jihulab.hk') + + aggregate_failures do + expect(described_class.context_matches?(:production)).to be_truthy + expect(described_class.context_matches?(domain: 'gitlab')).to be_falsey + expect(described_class.context_matches?(domain: 'jihulab')).to be_truthy + end + end + it 'matches tld' do QA::Runtime::Scenario.define(:gitlab_address, 'https://gitlab.cn') @@ -119,6 +162,7 @@ RSpec.describe QA::Specs::Helpers::ContextSelector do context 'with different environment set' do before do + allow(GitlabEdition).to receive(:jh?).and_return(false) QA::Runtime::Scenario.define(:gitlab_address, 'https://gitlab.com') end @@ -140,6 +184,31 @@ RSpec.describe QA::Specs::Helpers::ContextSelector do end end end + + context 'with different environment set on jh side' do + before do + allow(GitlabEdition).to receive(:jh?).and_return(true) + QA::Runtime::Scenario.define(:gitlab_address, 'https://jihulab.com') + end + + it 'does not run against production' do + group = describe_successfully 'Runs in staging', :something, only: { subdomain: :staging } do + it('runs in staging') {} + end + + expect(group.examples[0].execution_result.status).to eq(:pending) + end + + context 'when excluding contexts' do + it 'runs against production' do + group = describe_successfully 'Runs in staging', :something, except: { subdomain: :staging } do + it('runs in staging') {} + end + + expect(group.examples[0].execution_result.status).to eq(:passed) + end + end + end end it 'runs only in staging' do @@ -226,6 +295,7 @@ RSpec.describe QA::Specs::Helpers::ContextSelector do context 'production' do before do + allow(GitlabEdition).to receive(:jh?).and_return(false) QA::Runtime::Scenario.define(:gitlab_address, 'https://gitlab.com/') end @@ -260,6 +330,80 @@ RSpec.describe QA::Specs::Helpers::ContextSelector do end end + context 'jh mainland production ' do + before do + allow(GitlabEdition).to receive(:jh?).and_return(true) + QA::Runtime::Scenario.define(:gitlab_address, 'https://jihulab.com/') + end + + it 'runs on production' do + group = describe_successfully do + it('runs on prod', only: :production) {} + it('does not run in prod', only: { subdomain: :staging }) {} + it('runs in prod and staging', only: { subdomain: /(staging.)?/, domain: 'jihulab' }) {} + end + + aggregate_failures do + expect(group.examples[0].execution_result.status).to eq(:passed) + expect(group.examples[1].execution_result.status).to eq(:pending) + expect(group.examples[2].execution_result.status).to eq(:passed) + end + end + + context 'when excluding contexts' do + it 'skips production' do + group = describe_successfully do + it('skips prod', except: :production) {} + it('runs on prod', except: { subdomain: :staging }) {} + it('skips prod and staging', except: { subdomain: /(staging.)?/, domain: 'jihulab' }) {} + end + + aggregate_failures do + expect(group.examples[0].execution_result.status).to eq(:pending) + expect(group.examples[1].execution_result.status).to eq(:passed) + expect(group.examples[2].execution_result.status).to eq(:pending) + end + end + end + end + + context 'jh hk production ' do + before do + allow(GitlabEdition).to receive(:jh?).and_return(true) + QA::Runtime::Scenario.define(:gitlab_address, 'https://jihulab.hk/') + end + + it 'runs on production' do + group = describe_successfully do + it('runs on prod', only: :production) {} + it('does not run in prod', only: { subdomain: :staging }) {} + it('runs in prod and staging', only: { subdomain: /(staging.)?/, domain: 'jihulab' }) {} + end + + aggregate_failures do + expect(group.examples[0].execution_result.status).to eq(:passed) + expect(group.examples[1].execution_result.status).to eq(:pending) + expect(group.examples[2].execution_result.status).to eq(:passed) + end + end + + context 'when excluding contexts' do + it 'skips production' do + group = describe_successfully do + it('skips prod', except: :production) {} + it('runs on prod', except: { subdomain: :staging }) {} + it('skips prod and staging', except: { subdomain: /(staging.)?/, domain: 'jihulab' }) {} + end + + aggregate_failures do + expect(group.examples[0].execution_result.status).to eq(:pending) + expect(group.examples[1].execution_result.status).to eq(:passed) + expect(group.examples[2].execution_result.status).to eq(:pending) + end + end + end + end + it 'outputs a message for invalid environments' do group = describe_successfully do it('will skip', only: :production) {} diff --git a/qa/spec/specs/helpers/feature_flag_spec.rb b/qa/spec/specs/helpers/feature_flag_spec.rb index 491fc22f026..5ec829161ad 100644 --- a/qa/spec/specs/helpers/feature_flag_spec.rb +++ b/qa/spec/specs/helpers/feature_flag_spec.rb @@ -122,6 +122,10 @@ RSpec.describe QA::Specs::Helpers::FeatureFlag do end context 'when run on production' do + before do + allow(GitlabEdition).to receive(:jh?).and_return(false) + end + before(:context) do QA::Runtime::Scenario.define(:gitlab_address, 'https://gitlab.com') end @@ -147,6 +151,60 @@ RSpec.describe QA::Specs::Helpers::FeatureFlag do it_behaves_like 'skips with given feature flag metadata', { name: 'global_ff', scope: :global } end + context 'when run on jh production' do + before do + allow(GitlabEdition).to receive(:jh?).and_return(true) + end + + context 'when on mainland' do + before(:context) do + QA::Runtime::Scenario.define(:gitlab_address, 'https://jihulab.com') + end + + context 'when no scope is defined' do + it_behaves_like 'skips with given feature flag metadata', { name: 'no_scope_ff' } + + context 'for only one test in the example group' do + it 'only skips specified test and runs all others' do + group = describe_successfully 'Feature flag set for one test' do + it('is skipped', feature_flag: { name: 'single_test_ff' }) {} + it('passes') {} + end + + expect(group.examples[0].execution_result.status).to eq(:pending) + expect(group.examples[1].execution_result.status).to eq(:passed) + end + end + end + end + + context 'when on hk' do + before(:context) do + QA::Runtime::Scenario.define(:gitlab_address, 'https://jihulab.hk') + end + + context 'when no scope is defined' do + it_behaves_like 'skips with given feature flag metadata', { name: 'no_scope_ff' } + + context 'for only one test in the example group' do + it 'only skips specified test and runs all others' do + group = describe_successfully 'Feature flag set for one test' do + it('is skipped', feature_flag: { name: 'single_test_ff' }) {} + it('passes') {} + end + + expect(group.examples[0].execution_result.status).to eq(:pending) + expect(group.examples[1].execution_result.status).to eq(:passed) + end + end + end + end + + it_behaves_like 'skips with given feature flag metadata', { name: 'actor_ff', scope: :project } + + it_behaves_like 'skips with given feature flag metadata', { name: 'global_ff', scope: :global } + end + context 'when run on pre' do before(:context) do QA::Runtime::Scenario.define(:gitlab_address, 'https://pre.gitlab.com') diff --git a/spec/frontend/__helpers__/vue_mock_directive.js b/spec/frontend/__helpers__/vue_mock_directive.js index e952f258c4d..e7a2aa7f10d 100644 --- a/spec/frontend/__helpers__/vue_mock_directive.js +++ b/spec/frontend/__helpers__/vue_mock_directive.js @@ -2,7 +2,7 @@ export const getKey = (name) => `$_gl_jest_${name}`; export const getBinding = (el, name) => el[getKey(name)]; -const writeBindingToElement = (el, { name, value, arg, modifiers }) => { +const writeBindingToElement = (el, name, { value, arg, modifiers }) => { el[getKey(name)] = { value, arg, @@ -10,16 +10,24 @@ const writeBindingToElement = (el, { name, value, arg, modifiers }) => { }; }; -export const createMockDirective = () => ({ - bind(el, binding) { - writeBindingToElement(el, binding); - }, +export const createMockDirective = (name) => { + if (!name) { + throw new Error( + 'Vue 3 no longer passes the name of the directive to its hooks, an explicit name is required', + ); + } - update(el, binding) { - writeBindingToElement(el, binding); - }, + return { + bind(el, binding) { + writeBindingToElement(el, name, binding); + }, - unbind(el, { name }) { - delete el[getKey(name)]; - }, -}); + update(el, binding) { + writeBindingToElement(el, name, binding); + }, + + unbind(el) { + delete el[getKey(name)]; + }, + }; +}; diff --git a/spec/frontend/admin/topics/components/remove_avatar_spec.js b/spec/frontend/admin/topics/components/remove_avatar_spec.js index 97d257c682c..f058eef3a3a 100644 --- a/spec/frontend/admin/topics/components/remove_avatar_spec.js +++ b/spec/frontend/admin/topics/components/remove_avatar_spec.js @@ -20,7 +20,7 @@ describe('RemoveAvatar', () => { name, }, directives: { - GlModal: createMockDirective(), + GlModal: createMockDirective('gl-modal'), }, stubs: { GlSprintf, diff --git a/spec/frontend/admin/users/components/user_actions_spec.js b/spec/frontend/admin/users/components/user_actions_spec.js index 1b080b05c95..84966998e82 100644 --- a/spec/frontend/admin/users/components/user_actions_spec.js +++ b/spec/frontend/admin/users/components/user_actions_spec.js @@ -32,7 +32,7 @@ describe('AdminUserActions component', () => { showButtonLabels, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/admin/users/components/user_avatar_spec.js b/spec/frontend/admin/users/components/user_avatar_spec.js index 94fac875fbe..dc1770daee5 100644 --- a/spec/frontend/admin/users/components/user_avatar_spec.js +++ b/spec/frontend/admin/users/components/user_avatar_spec.js @@ -26,7 +26,7 @@ describe('AdminUserAvatar component', () => { ...props, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, stubs: { GlAvatarLabeled, diff --git a/spec/frontend/alert_management/components/alert_management_table_spec.js b/spec/frontend/alert_management/components/alert_management_table_spec.js index 7fb4f2d2463..3f709d8c9f5 100644 --- a/spec/frontend/alert_management/components/alert_management_table_spec.js +++ b/spec/frontend/alert_management/components/alert_management_table_spec.js @@ -68,7 +68,7 @@ describe('AlertManagementTable', () => { }, stubs, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }), ); diff --git a/spec/frontend/boards/board_card_inner_spec.js b/spec/frontend/boards/board_card_inner_spec.js index 1e823e3321a..a9342af0c96 100644 --- a/spec/frontend/boards/board_card_inner_spec.js +++ b/spec/frontend/boards/board_card_inner_spec.js @@ -84,7 +84,7 @@ describe('Board card component', () => { BoardCardMoveToPosition: true, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, provide: { rootPath: '/', diff --git a/spec/frontend/boards/components/board_add_new_column_trigger_spec.js b/spec/frontend/boards/components/board_add_new_column_trigger_spec.js index 354eb7bff16..f42b1325548 100644 --- a/spec/frontend/boards/components/board_add_new_column_trigger_spec.js +++ b/spec/frontend/boards/components/board_add_new_column_trigger_spec.js @@ -17,7 +17,7 @@ describe('BoardAddNewColumnTrigger', () => { const mountComponent = () => { wrapper = mountExtended(BoardAddNewColumnTrigger, { directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, store: createStore(), }); diff --git a/spec/frontend/boards/components/board_settings_sidebar_spec.js b/spec/frontend/boards/components/board_settings_sidebar_spec.js index 7d602042685..f4ecbbbed1c 100644 --- a/spec/frontend/boards/components/board_settings_sidebar_spec.js +++ b/spec/frontend/boards/components/board_settings_sidebar_spec.js @@ -48,7 +48,7 @@ describe('BoardSettingsSidebar', () => { isIssueBoard: true, }, directives: { - GlModal: createMockDirective(), + GlModal: createMockDirective('gl-modal'), }, stubs: { GlDrawer: stubComponent(GlDrawer, { diff --git a/spec/frontend/boards/components/toggle_focus_spec.js b/spec/frontend/boards/components/toggle_focus_spec.js index 3cbaac91f8d..a3d58fa05fd 100644 --- a/spec/frontend/boards/components/toggle_focus_spec.js +++ b/spec/frontend/boards/components/toggle_focus_spec.js @@ -10,7 +10,7 @@ describe('ToggleFocus', () => { const createComponent = () => { wrapper = shallowMountExtended(ToggleFocus, { directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, attachTo: document.body, }); diff --git a/spec/frontend/branches/components/delete_merged_branches_spec.js b/spec/frontend/branches/components/delete_merged_branches_spec.js index 4f1e772f4a4..274962fd364 100644 --- a/spec/frontend/branches/components/delete_merged_branches_spec.js +++ b/spec/frontend/branches/components/delete_merged_branches_spec.js @@ -27,7 +27,7 @@ const createComponent = (mountFn = shallowMountExtended, stubs = {}) => { ...propsDataMock, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, stubs, }); diff --git a/spec/frontend/ci/pipeline_editor/components/file-tree/container_spec.js b/spec/frontend/ci/pipeline_editor/components/file-tree/container_spec.js index 11ba517e0eb..e030412f2f5 100644 --- a/spec/frontend/ci/pipeline_editor/components/file-tree/container_spec.js +++ b/spec/frontend/ci/pipeline_editor/components/file-tree/container_spec.js @@ -22,7 +22,7 @@ describe('Pipeline editor file nav', () => { includes, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, stubs, }), diff --git a/spec/frontend/ci/runner/admin_new_runner_app/admin_new_runner_app_spec.js b/spec/frontend/ci/runner/admin_new_runner_app/admin_new_runner_app_spec.js index edf3d1706cc..dd7b0796f6e 100644 --- a/spec/frontend/ci/runner/admin_new_runner_app/admin_new_runner_app_spec.js +++ b/spec/frontend/ci/runner/admin_new_runner_app/admin_new_runner_app_spec.js @@ -29,7 +29,7 @@ describe('AdminNewRunnerApp', () => { ...props, }, directives: { - GlModal: createMockDirective(), + GlModal: createMockDirective('gl-modal'), }, stubs: { GlSprintf, diff --git a/spec/frontend/ci/runner/components/cells/runner_owner_cell_spec.js b/spec/frontend/ci/runner/components/cells/runner_owner_cell_spec.js index 3097e43e583..588d438b484 100644 --- a/spec/frontend/ci/runner/components/cells/runner_owner_cell_spec.js +++ b/spec/frontend/ci/runner/components/cells/runner_owner_cell_spec.js @@ -16,7 +16,7 @@ describe('RunnerOwnerCell', () => { const createComponent = ({ runner } = {}) => { wrapper = shallowMount(RunnerOwnerCell, { directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, propsData: { runner, diff --git a/spec/frontend/ci/runner/components/cells/runner_summary_field_spec.js b/spec/frontend/ci/runner/components/cells/runner_summary_field_spec.js index f536e0dcbcf..a5047e51f9f 100644 --- a/spec/frontend/ci/runner/components/cells/runner_summary_field_spec.js +++ b/spec/frontend/ci/runner/components/cells/runner_summary_field_spec.js @@ -17,7 +17,7 @@ describe('RunnerSummaryField', () => { ...props, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, ...options, }); diff --git a/spec/frontend/ci/runner/components/registration/registration_token_reset_dropdown_item_spec.js b/spec/frontend/ci/runner/components/registration/registration_token_reset_dropdown_item_spec.js index 783a4d9252a..71e54e34372 100644 --- a/spec/frontend/ci/runner/components/registration/registration_token_reset_dropdown_item_spec.js +++ b/spec/frontend/ci/runner/components/registration/registration_token_reset_dropdown_item_spec.js @@ -43,7 +43,7 @@ describe('RegistrationTokenResetDropdownItem', () => { [runnersRegistrationTokenResetMutation, runnersRegistrationTokenResetMutationHandler], ]), directives: { - GlModal: createMockDirective(), + GlModal: createMockDirective('gl-modal'), }, }); diff --git a/spec/frontend/ci/runner/components/runner_bulk_delete_spec.js b/spec/frontend/ci/runner/components/runner_bulk_delete_spec.js index 0dc5a90fb83..05ceed931bd 100644 --- a/spec/frontend/ci/runner/components/runner_bulk_delete_spec.js +++ b/spec/frontend/ci/runner/components/runner_bulk_delete_spec.js @@ -51,7 +51,7 @@ describe('RunnerBulkDelete', () => { runners: mockRunners, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, stubs: { GlSprintf, diff --git a/spec/frontend/ci/runner/components/runner_delete_button_spec.js b/spec/frontend/ci/runner/components/runner_delete_button_spec.js index 02960ad427e..a97c9902ceb 100644 --- a/spec/frontend/ci/runner/components/runner_delete_button_spec.js +++ b/spec/frontend/ci/runner/components/runner_delete_button_spec.js @@ -53,8 +53,8 @@ describe('RunnerDeleteButton', () => { }, apolloProvider, directives: { - GlTooltip: createMockDirective(), - GlModal: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), + GlModal: createMockDirective('gl-modal'), }, }); }; diff --git a/spec/frontend/ci/runner/components/runner_edit_button_spec.js b/spec/frontend/ci/runner/components/runner_edit_button_spec.js index 907cdc90100..16586dc46d5 100644 --- a/spec/frontend/ci/runner/components/runner_edit_button_spec.js +++ b/spec/frontend/ci/runner/components/runner_edit_button_spec.js @@ -11,7 +11,7 @@ describe('RunnerEditButton', () => { wrapper = mountFn(RunnerEditButton, { attrs, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/ci/runner/components/runner_list_empty_state_spec.js b/spec/frontend/ci/runner/components/runner_list_empty_state_spec.js index 6aea3ddf58c..9dd6577a166 100644 --- a/spec/frontend/ci/runner/components/runner_list_empty_state_spec.js +++ b/spec/frontend/ci/runner/components/runner_list_empty_state_spec.js @@ -31,7 +31,7 @@ describe('RunnerListEmptyState', () => { ...props, }, directives: { - GlModal: createMockDirective(), + GlModal: createMockDirective('gl-modal'), }, stubs: { GlEmptyState, diff --git a/spec/frontend/ci/runner/components/runner_pause_button_spec.js b/spec/frontend/ci/runner/components/runner_pause_button_spec.js index 12680e01b98..dc9925f153b 100644 --- a/spec/frontend/ci/runner/components/runner_pause_button_spec.js +++ b/spec/frontend/ci/runner/components/runner_pause_button_spec.js @@ -46,7 +46,7 @@ describe('RunnerPauseButton', () => { }, apolloProvider: createMockApollo([[runnerToggleActiveMutation, runnerToggleActiveHandler]]), directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/ci/runner/components/runner_paused_badge_spec.js b/spec/frontend/ci/runner/components/runner_paused_badge_spec.js index b051ebe99a7..879597ce44d 100644 --- a/spec/frontend/ci/runner/components/runner_paused_badge_spec.js +++ b/spec/frontend/ci/runner/components/runner_paused_badge_spec.js @@ -16,7 +16,7 @@ describe('RunnerTypeBadge', () => { ...props, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/ci/runner/components/runner_status_badge_spec.js b/spec/frontend/ci/runner/components/runner_status_badge_spec.js index 45b410df2d4..8cde6369d48 100644 --- a/spec/frontend/ci/runner/components/runner_status_badge_spec.js +++ b/spec/frontend/ci/runner/components/runner_status_badge_spec.js @@ -31,7 +31,7 @@ describe('RunnerTypeBadge', () => { ...props, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/ci/runner/components/runner_tag_spec.js b/spec/frontend/ci/runner/components/runner_tag_spec.js index 7bcb046ae43..59bfe1585e9 100644 --- a/spec/frontend/ci/runner/components/runner_tag_spec.js +++ b/spec/frontend/ci/runner/components/runner_tag_spec.js @@ -29,8 +29,8 @@ describe('RunnerTag', () => { ...props, }, directives: { - GlTooltip: createMockDirective(), - GlResizeObserver: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), + GlResizeObserver: createMockDirective('gl-resize-observer'), }, }); }; diff --git a/spec/frontend/ci/runner/components/runner_type_badge_spec.js b/spec/frontend/ci/runner/components/runner_type_badge_spec.js index 58f09362759..acf9486064f 100644 --- a/spec/frontend/ci/runner/components/runner_type_badge_spec.js +++ b/spec/frontend/ci/runner/components/runner_type_badge_spec.js @@ -23,7 +23,7 @@ describe('RunnerTypeBadge', () => { ...props, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/clusters/agents/components/create_token_button_spec.js b/spec/frontend/clusters/agents/components/create_token_button_spec.js index 73856b74a8d..aadd11e9b5f 100644 --- a/spec/frontend/clusters/agents/components/create_token_button_spec.js +++ b/spec/frontend/clusters/agents/components/create_token_button_spec.js @@ -21,7 +21,7 @@ describe('CreateTokenButton', () => { ...provideData, }, directives: { - GlModalDirective: createMockDirective(), + GlModalDirective: createMockDirective('gl-modal-directive'), }, stubs: { GlTooltip, diff --git a/spec/frontend/clusters_list/components/clusters_actions_spec.js b/spec/frontend/clusters_list/components/clusters_actions_spec.js index f4ee3f93cb5..7c0157c473b 100644 --- a/spec/frontend/clusters_list/components/clusters_actions_spec.js +++ b/spec/frontend/clusters_list/components/clusters_actions_spec.js @@ -35,7 +35,7 @@ describe('ClustersActionsComponent', () => { ...provideData, }, directives: { - GlModalDirective: createMockDirective(), + GlModalDirective: createMockDirective('gl-modal-directive'), }, }); }; diff --git a/spec/frontend/clusters_list/components/delete_agent_button_spec.js b/spec/frontend/clusters_list/components/delete_agent_button_spec.js index 82850b9dea4..e8eff45135f 100644 --- a/spec/frontend/clusters_list/components/delete_agent_button_spec.js +++ b/spec/frontend/clusters_list/components/delete_agent_button_spec.js @@ -84,7 +84,7 @@ describe('DeleteAgentButton', () => { ...provideData, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, propsData, mocks: { $toast: { show: toast } }, diff --git a/spec/frontend/environments/canary_ingress_spec.js b/spec/frontend/environments/canary_ingress_spec.js index 340740e6499..eb3dec27cb6 100644 --- a/spec/frontend/environments/canary_ingress_spec.js +++ b/spec/frontend/environments/canary_ingress_spec.js @@ -23,7 +23,7 @@ describe('/environments/components/canary_ingress.vue', () => { ...props, }, directives: { - GlModal: createMockDirective(), + GlModal: createMockDirective('gl-modal'), }, ...options, }); diff --git a/spec/frontend/environments/environment_actions_spec.js b/spec/frontend/environments/environment_actions_spec.js index 48483152f7a..b79f899b6d4 100644 --- a/spec/frontend/environments/environment_actions_spec.js +++ b/spec/frontend/environments/environment_actions_spec.js @@ -36,7 +36,7 @@ describe('EnvironmentActions Component', () => { wrapper = mountFn(EnvironmentActions, { propsData: { actions: [], ...props }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, ...options, }); diff --git a/spec/frontend/environments/environments_detail_header_spec.js b/spec/frontend/environments/environments_detail_header_spec.js index 1f233c05fbf..0b5f076ba9f 100644 --- a/spec/frontend/environments/environments_detail_header_spec.js +++ b/spec/frontend/environments/environments_detail_header_spec.js @@ -47,7 +47,7 @@ describe('Environments detail header component', () => { TimeAgo, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, propsData: { canAdminEnvironment: false, diff --git a/spec/frontend/ide/components/commit_sidebar/form_spec.js b/spec/frontend/ide/components/commit_sidebar/form_spec.js index a8ee81afa0b..98100727630 100644 --- a/spec/frontend/ide/components/commit_sidebar/form_spec.js +++ b/spec/frontend/ide/components/commit_sidebar/form_spec.js @@ -26,7 +26,7 @@ describe('IDE commit form', () => { wrapper = shallowMount(CommitForm, { store, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, stubs: { GlModal: stubComponent(GlModal), diff --git a/spec/frontend/ide/components/commit_sidebar/new_merge_request_option_spec.js b/spec/frontend/ide/components/commit_sidebar/new_merge_request_option_spec.js index 2a455c9d7c1..8827dd41a74 100644 --- a/spec/frontend/ide/components/commit_sidebar/new_merge_request_option_spec.js +++ b/spec/frontend/ide/components/commit_sidebar/new_merge_request_option_spec.js @@ -33,7 +33,7 @@ describe('NewMergeRequestOption component', () => { }, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/ide/components/commit_sidebar/radio_group_spec.js b/spec/frontend/ide/components/commit_sidebar/radio_group_spec.js index a3fa03a4aa5..589d282e4c4 100644 --- a/spec/frontend/ide/components/commit_sidebar/radio_group_spec.js +++ b/spec/frontend/ide/components/commit_sidebar/radio_group_spec.js @@ -19,7 +19,7 @@ describe('IDE commit sidebar radio group', () => { propsData: config.props, slots: config.slots, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/ide/components/ide_sidebar_nav_spec.js b/spec/frontend/ide/components/ide_sidebar_nav_spec.js index 80e8aba4072..b7aa99747b3 100644 --- a/spec/frontend/ide/components/ide_sidebar_nav_spec.js +++ b/spec/frontend/ide/components/ide_sidebar_nav_spec.js @@ -37,7 +37,7 @@ describe('ide/components/ide_sidebar_nav', () => { ...props, }, directives: { - tooltip: createMockDirective(), + tooltip: createMockDirective('tooltip'), }, }); }; diff --git a/spec/frontend/import_entities/import_groups/components/import_table_spec.js b/spec/frontend/import_entities/import_groups/components/import_table_spec.js index c7bda5a60ec..904fd25b378 100644 --- a/spec/frontend/import_entities/import_groups/components/import_table_spec.js +++ b/spec/frontend/import_entities/import_groups/components/import_table_spec.js @@ -102,7 +102,7 @@ describe('import table', () => { defaultTargetNamespace, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, provide: { glFeatures, diff --git a/spec/frontend/issuable/components/csv_import_export_buttons_spec.js b/spec/frontend/issuable/components/csv_import_export_buttons_spec.js index 118c12d968b..a392198030d 100644 --- a/spec/frontend/issuable/components/csv_import_export_buttons_spec.js +++ b/spec/frontend/issuable/components/csv_import_export_buttons_spec.js @@ -16,7 +16,7 @@ describe('CsvImportExportButtons', () => { glModalDirective = jest.fn(); return mountExtended(CsvImportExportButtons, { directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), glModal: { bind(_, { value }) { glModalDirective(value); diff --git a/spec/frontend/issuable/components/issuable_header_warnings_spec.js b/spec/frontend/issuable/components/issuable_header_warnings_spec.js index 99aa6778e1e..690bbf585de 100644 --- a/spec/frontend/issuable/components/issuable_header_warnings_spec.js +++ b/spec/frontend/issuable/components/issuable_header_warnings_spec.js @@ -25,7 +25,7 @@ describe('IssuableHeaderWarnings', () => { store, provide, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/issues/show/components/app_spec.js b/spec/frontend/issues/show/components/app_spec.js index 5c69d46f9db..9284e711300 100644 --- a/spec/frontend/issues/show/components/app_spec.js +++ b/spec/frontend/issues/show/components/app_spec.js @@ -60,7 +60,7 @@ describe('Issuable output', () => { const mountComponent = (props = {}, options = {}, data = {}) => { wrapper = shallowMountExtended(IssuableApp, { directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, propsData: { ...appProps, ...props }, provide: { diff --git a/spec/frontend/jira_connect/subscriptions/components/add_namespace_button_spec.js b/spec/frontend/jira_connect/subscriptions/components/add_namespace_button_spec.js index 9f92ad2adc1..06fad25dbf3 100644 --- a/spec/frontend/jira_connect/subscriptions/components/add_namespace_button_spec.js +++ b/spec/frontend/jira_connect/subscriptions/components/add_namespace_button_spec.js @@ -11,7 +11,7 @@ describe('AddNamespaceButton', () => { const createComponent = () => { wrapper = shallowMount(AddNamespaceButton, { directives: { - glModal: createMockDirective(), + glModal: createMockDirective('gl-modal'), }, }); }; diff --git a/spec/frontend/members/components/action_buttons/approve_access_request_button_spec.js b/spec/frontend/members/components/action_buttons/approve_access_request_button_spec.js index 15bb03480e1..621ed968972 100644 --- a/spec/frontend/members/components/action_buttons/approve_access_request_button_spec.js +++ b/spec/frontend/members/components/action_buttons/approve_access_request_button_spec.js @@ -38,7 +38,7 @@ describe('ApproveAccessRequestButton', () => { ...propsData, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/members/components/action_buttons/remove_group_link_button_spec.js b/spec/frontend/members/components/action_buttons/remove_group_link_button_spec.js index b511cebdf28..4b50aa083ee 100644 --- a/spec/frontend/members/components/action_buttons/remove_group_link_button_spec.js +++ b/spec/frontend/members/components/action_buttons/remove_group_link_button_spec.js @@ -37,7 +37,7 @@ describe('RemoveGroupLinkButton', () => { groupLink: group, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/members/components/action_buttons/remove_member_button_spec.js b/spec/frontend/members/components/action_buttons/remove_member_button_spec.js index cca340169b7..d3d732f9793 100644 --- a/spec/frontend/members/components/action_buttons/remove_member_button_spec.js +++ b/spec/frontend/members/components/action_buttons/remove_member_button_spec.js @@ -47,7 +47,7 @@ describe('RemoveMemberButton', () => { ...propsData, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/members/components/action_buttons/resend_invite_button_spec.js b/spec/frontend/members/components/action_buttons/resend_invite_button_spec.js index 51cfd47ddf4..ca51cbea1d1 100644 --- a/spec/frontend/members/components/action_buttons/resend_invite_button_spec.js +++ b/spec/frontend/members/components/action_buttons/resend_invite_button_spec.js @@ -38,7 +38,7 @@ describe('ResendInviteButton', () => { ...propsData, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/members/components/action_dropdowns/leave_group_dropdown_item_spec.js b/spec/frontend/members/components/action_dropdowns/leave_group_dropdown_item_spec.js index 90f5b217007..b88f9cd0db2 100644 --- a/spec/frontend/members/components/action_dropdowns/leave_group_dropdown_item_spec.js +++ b/spec/frontend/members/components/action_dropdowns/leave_group_dropdown_item_spec.js @@ -18,7 +18,7 @@ describe('LeaveGroupDropdownItem', () => { ...propsData, }, directives: { - GlModal: createMockDirective(), + GlModal: createMockDirective('gl-modal'), }, slots: { default: text, diff --git a/spec/frontend/members/components/action_dropdowns/user_action_dropdown_spec.js b/spec/frontend/members/components/action_dropdowns/user_action_dropdown_spec.js index 5a2de1cac80..cc1d9972f60 100644 --- a/spec/frontend/members/components/action_dropdowns/user_action_dropdown_spec.js +++ b/spec/frontend/members/components/action_dropdowns/user_action_dropdown_spec.js @@ -24,7 +24,7 @@ describe('UserActionDropdown', () => { ...propsData, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/members/components/table/member_source_spec.js b/spec/frontend/members/components/table/member_source_spec.js index fbfd0ca7ae7..b4f3c2b042b 100644 --- a/spec/frontend/members/components/table/member_source_spec.js +++ b/spec/frontend/members/components/table/member_source_spec.js @@ -23,7 +23,7 @@ describe('MemberSource', () => { ...propsData, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/nav/components/responsive_header_spec.js b/spec/frontend/nav/components/responsive_header_spec.js index f87de0afb14..c9c0b1127bf 100644 --- a/spec/frontend/nav/components/responsive_header_spec.js +++ b/spec/frontend/nav/components/responsive_header_spec.js @@ -14,7 +14,7 @@ describe('~/nav/components/top_nav_menu_sections.vue', () => { default: TEST_SLOT_CONTENT, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/nav/components/responsive_home_spec.js b/spec/frontend/nav/components/responsive_home_spec.js index 8f198d92747..7cd958420eb 100644 --- a/spec/frontend/nav/components/responsive_home_spec.js +++ b/spec/frontend/nav/components/responsive_home_spec.js @@ -29,7 +29,7 @@ describe('~/nav/components/responsive_home.vue', () => { ...props, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, listeners: { 'menu-item-click': menuItemClickListener, diff --git a/spec/frontend/notifications/components/notifications_dropdown_spec.js b/spec/frontend/notifications/components/notifications_dropdown_spec.js index 0f13de0e6d8..75e88d48ebd 100644 --- a/spec/frontend/notifications/components/notifications_dropdown_spec.js +++ b/spec/frontend/notifications/components/notifications_dropdown_spec.js @@ -25,7 +25,7 @@ describe('NotificationsDropdown', () => { CustomNotificationsModal, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, provide: { dropdownItems: mockDropdownItems, diff --git a/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/details_header_spec.js b/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/details_header_spec.js index b37edac83f7..a825319f546 100644 --- a/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/details_header_spec.js +++ b/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/details_header_spec.js @@ -73,7 +73,7 @@ describe('Details Header', () => { apolloProvider, propsData, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, stubs: { TitleArea, diff --git a/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js b/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js index fa0d76762df..d2d3be256e5 100644 --- a/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js +++ b/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js @@ -50,7 +50,7 @@ describe('tags list row', () => { }, propsData, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/image_list_row_spec.js b/spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/image_list_row_spec.js index 75068591007..7b20855bf4c 100644 --- a/spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/image_list_row_spec.js +++ b/spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/image_list_row_spec.js @@ -49,7 +49,7 @@ describe('Image List Row', () => { config: {}, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/packages_and_registries/infrastructure_registry/components/shared/package_list_row_spec.js b/spec/frontend/packages_and_registries/infrastructure_registry/components/shared/package_list_row_spec.js index 721bdd34a4f..4a7542ca509 100644 --- a/spec/frontend/packages_and_registries/infrastructure_registry/components/shared/package_list_row_spec.js +++ b/spec/frontend/packages_and_registries/infrastructure_registry/components/shared/package_list_row_spec.js @@ -49,7 +49,7 @@ describe('packages_list_row', () => { disableDelete, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js b/spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js index 1fda77f2aaa..142f8d03c5d 100644 --- a/spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js +++ b/spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js @@ -38,7 +38,7 @@ describe('PackageTitle', () => { }, provide, directives: { - GlResizeObserver: createMockDirective(), + GlResizeObserver: createMockDirective('gl-resize-observer'), }, }); await nextTick(); diff --git a/spec/frontend/packages_and_registries/package_registry/components/details/version_row_spec.js b/spec/frontend/packages_and_registries/package_registry/components/details/version_row_spec.js index 67340822fa5..8cb51aaf738 100644 --- a/spec/frontend/packages_and_registries/package_registry/components/details/version_row_spec.js +++ b/spec/frontend/packages_and_registries/package_registry/components/details/version_row_spec.js @@ -36,7 +36,7 @@ describe('VersionRow', () => { GlTruncate, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); } diff --git a/spec/frontend/packages_and_registries/package_registry/components/list/package_list_row_spec.js b/spec/frontend/packages_and_registries/package_registry/components/list/package_list_row_spec.js index 2a78cfb13f9..19d56fe8cc6 100644 --- a/spec/frontend/packages_and_registries/package_registry/components/list/package_list_row_spec.js +++ b/spec/frontend/packages_and_registries/package_registry/components/list/package_list_row_spec.js @@ -67,7 +67,7 @@ describe('packages_list_row', () => { selected, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/packages_and_registries/shared/components/package_path_spec.js b/spec/frontend/packages_and_registries/shared/components/package_path_spec.js index 93425d4f399..cce65d3d0bc 100644 --- a/spec/frontend/packages_and_registries/shared/components/package_path_spec.js +++ b/spec/frontend/packages_and_registries/shared/components/package_path_spec.js @@ -9,7 +9,7 @@ describe('PackagePath', () => { wrapper = shallowMount(PackagePath, { propsData, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/pages/admin/jobs/index/components/cancel_jobs_spec.js b/spec/frontend/pages/admin/jobs/index/components/cancel_jobs_spec.js index ec6369e7119..de6d44eabdc 100644 --- a/spec/frontend/pages/admin/jobs/index/components/cancel_jobs_spec.js +++ b/spec/frontend/pages/admin/jobs/index/components/cancel_jobs_spec.js @@ -19,8 +19,8 @@ describe('CancelJobs component', () => { const createComponent = (props = {}) => { wrapper = shallowMountExtended(CancelJobs, { directives: { - GlModal: createMockDirective(), - GlTooltip: createMockDirective(), + GlModal: createMockDirective('gl-modal'), + GlTooltip: createMockDirective('gl-tooltip'), }, propsData: { url: `${TEST_HOST}/cancel_jobs_modal.vue/cancelAll`, diff --git a/spec/frontend/pipelines/components/pipeline_mini_graph/linked_pipelines_mini_list_spec.js b/spec/frontend/pipelines/components/pipeline_mini_graph/linked_pipelines_mini_list_spec.js index 5ea57c51e70..61dee1f5904 100644 --- a/spec/frontend/pipelines/components/pipeline_mini_graph/linked_pipelines_mini_list_spec.js +++ b/spec/frontend/pipelines/components/pipeline_mini_graph/linked_pipelines_mini_list_spec.js @@ -19,7 +19,7 @@ describe('Linked pipeline mini list', () => { const createComponent = (props = {}) => { wrapper = mount(LinkedPipelinesMiniList, { directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, propsData: { ...props, diff --git a/spec/frontend/pipelines/pipeline_triggerer_spec.js b/spec/frontend/pipelines/pipeline_triggerer_spec.js index 58bfb68e85c..671f193dcf0 100644 --- a/spec/frontend/pipelines/pipeline_triggerer_spec.js +++ b/spec/frontend/pipelines/pipeline_triggerer_spec.js @@ -22,7 +22,7 @@ describe('Pipelines Triggerer', () => { ...props, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/projects/prune_unreachable_objects_button_spec.js b/spec/frontend/projects/prune_unreachable_objects_button_spec.js index b345f264ca7..0471e213fba 100644 --- a/spec/frontend/projects/prune_unreachable_objects_button_spec.js +++ b/spec/frontend/projects/prune_unreachable_objects_button_spec.js @@ -22,7 +22,7 @@ describe('Project remove modal', () => { wrapper = shallowMountExtended(PruneObjectsButton, { propsData: defaultProps, directives: { - GlModal: createMockDirective(), + GlModal: createMockDirective('gl-modal'), }, }); }; diff --git a/spec/frontend/projects/settings/repository/branch_rules/app_spec.js b/spec/frontend/projects/settings/repository/branch_rules/app_spec.js index 56b39f04580..661f842066e 100644 --- a/spec/frontend/projects/settings/repository/branch_rules/app_spec.js +++ b/spec/frontend/projects/settings/repository/branch_rules/app_spec.js @@ -41,7 +41,7 @@ describe('Branch rules app', () => { apolloProvider: fakeApollo, provide: appProvideMock, stubs: { GlModal: stubComponent(GlModal, { template: RENDER_ALL_SLOTS_TEMPLATE }) }, - directives: { GlModal: createMockDirective() }, + directives: { GlModal: createMockDirective('gl-modal') }, }); await waitForPromises(); diff --git a/spec/frontend/repository/components/table/row_spec.js b/spec/frontend/repository/components/table/row_spec.js index 5d9138ab9cd..02796d487df 100644 --- a/spec/frontend/repository/components/table/row_spec.js +++ b/spec/frontend/repository/components/table/row_spec.js @@ -28,7 +28,7 @@ function factory(propsData = {}) { rowNumber: 123, }, directives: { - GlHoverLoad: createMockDirective(), + GlHoverLoad: createMockDirective('gl-hover-load'), }, mocks: { $router, diff --git a/spec/frontend/security_configuration/components/training_provider_list_spec.js b/spec/frontend/security_configuration/components/training_provider_list_spec.js index 8f2b5383191..f378c600ce1 100644 --- a/spec/frontend/security_configuration/components/training_provider_list_spec.js +++ b/spec/frontend/security_configuration/components/training_provider_list_spec.js @@ -106,7 +106,7 @@ describe('TrainingProviderList component', () => { projectFullPath: testProjectPath, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, propsData: { securityTrainingEnabled: true, diff --git a/spec/frontend/sidebar/components/incidents/sidebar_escalation_status_spec.js b/spec/frontend/sidebar/components/incidents/sidebar_escalation_status_spec.js index 2dded61c073..5e0e9f48926 100644 --- a/spec/frontend/sidebar/components/incidents/sidebar_escalation_status_spec.js +++ b/spec/frontend/sidebar/components/incidents/sidebar_escalation_status_spec.js @@ -57,7 +57,7 @@ describe('SidebarEscalationStatus', () => { canUpdate: true, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, apolloProvider, }); diff --git a/spec/frontend/sidebar/components/labels/labels_select_vue/dropdown_value_collapsed_spec.js b/spec/frontend/sidebar/components/labels/labels_select_vue/dropdown_value_collapsed_spec.js index 56f25a1c6a4..b33a890b9e3 100644 --- a/spec/frontend/sidebar/components/labels/labels_select_vue/dropdown_value_collapsed_spec.js +++ b/spec/frontend/sidebar/components/labels/labels_select_vue/dropdown_value_collapsed_spec.js @@ -19,7 +19,7 @@ describe('DropdownValueCollapsedComponent', () => { wrapper = shallowMount(DropdownValueCollapsedComponent, { propsData: { ...defaultProps, ...props }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/sidebar/components/lock/issuable_lock_form_spec.js b/spec/frontend/sidebar/components/lock/issuable_lock_form_spec.js index 8f825847cfc..eecab45b3e5 100644 --- a/spec/frontend/sidebar/components/lock/issuable_lock_form_spec.js +++ b/spec/frontend/sidebar/components/lock/issuable_lock_form_spec.js @@ -62,7 +62,7 @@ describe('IssuableLockForm', () => { ...props, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js b/spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js index 060a2873e04..0b7712cf29e 100644 --- a/spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js +++ b/spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js @@ -140,7 +140,7 @@ describe('SidebarDropdownWidget', () => { }, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, stubs: { SidebarEditableItem, diff --git a/spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js b/spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js index 45d8b5e4647..ed060ca2705 100644 --- a/spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js +++ b/spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js @@ -32,7 +32,7 @@ describe('Issuable Time Tracker', () => { const mountComponent = ({ props = {}, issuableType = 'issue', loading = false } = {}) => { return mount(TimeTracker, { propsData: { ...defaultProps, ...props }, - directives: { GlTooltip: createMockDirective() }, + directives: { GlTooltip: createMockDirective('gl-tooltip') }, stubs: { transition: stubTransition(), }, diff --git a/spec/frontend/terraform/components/states_table_spec.js b/spec/frontend/terraform/components/states_table_spec.js index 0b3b169891b..697e52e45ea 100644 --- a/spec/frontend/terraform/components/states_table_spec.js +++ b/spec/frontend/terraform/components/states_table_spec.js @@ -127,7 +127,7 @@ describe('StatesTable', () => { propsData, provide: { projectPath: 'path/to/project' }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }), ); diff --git a/spec/frontend/vue_shared/components/form/input_copy_toggle_visibility_spec.js b/spec/frontend/vue_shared/components/form/input_copy_toggle_visibility_spec.js index e1da8b690af..ae4f3156e2c 100644 --- a/spec/frontend/vue_shared/components/form/input_copy_toggle_visibility_spec.js +++ b/spec/frontend/vue_shared/components/form/input_copy_toggle_visibility_spec.js @@ -21,7 +21,7 @@ describe('InputCopyToggleVisibility', () => { InputCopyToggleVisibility, merge({}, options, { directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }), ); diff --git a/spec/frontend/vue_shared/components/markdown/suggestion_diff_header_spec.js b/spec/frontend/vue_shared/components/markdown/suggestion_diff_header_spec.js index 9db1b779a04..c2360773a65 100644 --- a/spec/frontend/vue_shared/components/markdown/suggestion_diff_header_spec.js +++ b/spec/frontend/vue_shared/components/markdown/suggestion_diff_header_spec.js @@ -25,7 +25,7 @@ describe('Suggestion Diff component', () => { ...props, }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/vue_shared/components/registry/metadata_item_spec.js b/spec/frontend/vue_shared/components/registry/metadata_item_spec.js index a04e1e237d4..8defeb76e19 100644 --- a/spec/frontend/vue_shared/components/registry/metadata_item_spec.js +++ b/spec/frontend/vue_shared/components/registry/metadata_item_spec.js @@ -14,7 +14,7 @@ describe('Metadata Item', () => { wrapper = shallowMount(component, { propsData, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/vue_shared/components/runner_instructions/runner_instructions_spec.js b/spec/frontend/vue_shared/components/runner_instructions/runner_instructions_spec.js index 986d76d2b95..68c126ab2ba 100644 --- a/spec/frontend/vue_shared/components/runner_instructions/runner_instructions_spec.js +++ b/spec/frontend/vue_shared/components/runner_instructions/runner_instructions_spec.js @@ -12,7 +12,7 @@ describe('RunnerInstructions component', () => { const createComponent = () => { wrapper = shallowMountExtended(RunnerInstructions, { directives: { - GlModal: createMockDirective(), + GlModal: createMockDirective('gl-tooltip'), }, }); }; diff --git a/spec/frontend/vue_shared/components/tooltip_on_truncate_spec.js b/spec/frontend/vue_shared/components/tooltip_on_truncate_spec.js index ca1f7996ad6..5e7b2a89235 100644 --- a/spec/frontend/vue_shared/components/tooltip_on_truncate_spec.js +++ b/spec/frontend/vue_shared/components/tooltip_on_truncate_spec.js @@ -30,8 +30,8 @@ describe('TooltipOnTruncate component', () => { default: [MOCK_TITLE], }, directives: { - GlTooltip: createMockDirective(), - GlResizeObserver: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), + GlResizeObserver: createMockDirective('gl-resize-observer'), }, ...options, }); @@ -42,8 +42,8 @@ describe('TooltipOnTruncate component', () => { ...TooltipOnTruncate, directives: { ...TooltipOnTruncate.directives, - GlTooltip: createMockDirective(), - GlResizeObserver: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), + GlResizeObserver: createMockDirective('gl-resize-observer'), }, }; diff --git a/spec/frontend/vue_shared/issuable/show/components/issuable_title_spec.js b/spec/frontend/vue_shared/issuable/show/components/issuable_title_spec.js index 6f62fb77353..619d0cb5dd3 100644 --- a/spec/frontend/vue_shared/issuable/show/components/issuable_title_spec.js +++ b/spec/frontend/vue_shared/issuable/show/components/issuable_title_spec.js @@ -22,7 +22,7 @@ const createComponent = (propsData = issuableTitleProps) => 'status-badge': 'Open', }, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); diff --git a/spec/frontend/whats_new/components/app_spec.js b/spec/frontend/whats_new/components/app_spec.js index ee15034daff..265e0344286 100644 --- a/spec/frontend/whats_new/components/app_spec.js +++ b/spec/frontend/whats_new/components/app_spec.js @@ -49,7 +49,7 @@ describe('App', () => { store, propsData: buildProps(), directives: { - GlResizeObserver: createMockDirective(), + GlResizeObserver: createMockDirective('gl-resize-observer'), }, }); }; diff --git a/spec/frontend/work_items/components/work_item_type_icon_spec.js b/spec/frontend/work_items/components/work_item_type_icon_spec.js index 182fb0f8cb6..dfcf9be3d61 100644 --- a/spec/frontend/work_items/components/work_item_type_icon_spec.js +++ b/spec/frontend/work_items/components/work_item_type_icon_spec.js @@ -9,7 +9,7 @@ function createComponent(propsData) { wrapper = shallowMount(WorkItemTypeIcon, { propsData, directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, }); } diff --git a/spec/models/bulk_import_spec.rb b/spec/models/bulk_import_spec.rb index 3430da43f62..acb1f4a2ef7 100644 --- a/spec/models/bulk_import_spec.rb +++ b/spec/models/bulk_import_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe BulkImport, type: :model do +RSpec.describe BulkImport, type: :model, feature_category: :importers do let_it_be(:created_bulk_import) { create(:bulk_import, :created) } let_it_be(:started_bulk_import) { create(:bulk_import, :started) } let_it_be(:finished_bulk_import) { create(:bulk_import, :finished) } @@ -48,4 +48,31 @@ RSpec.describe BulkImport, type: :model do expect(bulk_import.source_version_info.to_s).to eq(bulk_import.source_version) end end + + describe '#update_has_failures' do + let(:import) { create(:bulk_import, :started) } + let(:entity) { create(:bulk_import_entity, bulk_import: import) } + + context 'when entity has failures' do + it 'sets has_failures flag to true' do + expect(import.has_failures).to eq(false) + + entity.update!(has_failures: true) + import.fail_op! + + expect(import.has_failures).to eq(true) + end + end + + context 'when entity does not have failures' do + it 'sets has_failures flag to false' do + expect(import.has_failures).to eq(false) + + entity.update!(has_failures: false) + import.fail_op! + + expect(import.has_failures).to eq(false) + end + end + end end diff --git a/spec/models/bulk_imports/entity_spec.rb b/spec/models/bulk_imports/entity_spec.rb index 56796aa1fe4..2cb72e74979 100644 --- a/spec/models/bulk_imports/entity_spec.rb +++ b/spec/models/bulk_imports/entity_spec.rb @@ -412,4 +412,30 @@ RSpec.describe BulkImports::Entity, type: :model, feature_category: :importers d end end end + + describe '#update_has_failures' do + let(:entity) { create(:bulk_import_entity) } + + context 'when entity has failures' do + it 'sets has_failures flag to true' do + expect(entity.has_failures).to eq(false) + + create(:bulk_import_failure, entity: entity) + + entity.fail_op! + + expect(entity.has_failures).to eq(true) + end + end + + context 'when entity does not have failures' do + it 'sets has_failures flag to false' do + expect(entity.has_failures).to eq(false) + + entity.fail_op! + + expect(entity.has_failures).to eq(false) + end + end + end end |