diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-13 09:14:09 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-13 09:14:09 +0000 |
commit | 9bc96aa4f94943af9972ca7058ed31771bbcaa53 (patch) | |
tree | 134e7dfa9eb568c8db4abb9ea22ad420957ab544 | |
parent | 2d2181e35c3cff3411870100cd57c0ed8d95ec20 (diff) | |
download | gitlab-ce-9bc96aa4f94943af9972ca7058ed31771bbcaa53.tar.gz |
Add latest changes from gitlab-org/gitlab@master
32 files changed, 100 insertions, 166 deletions
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 938ba6046e8..4c61a482397 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -f9af7fbcbfda556c61dcbb2280cda6c6e210cb77 +27dddad834d99e9901b4a9b137748b850e71849a diff --git a/app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue b/app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue index b959d97daea..9c0ffab7f6b 100644 --- a/app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue +++ b/app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue @@ -1,5 +1,5 @@ <script> -import { GlTable, GlButton, GlModalDirective, GlIcon } from '@gitlab/ui'; +import { GlTable, GlButton, GlModalDirective, GlIcon, GlTooltipDirective } from '@gitlab/ui'; import { mapState, mapActions } from 'vuex'; import { s__, __ } from '~/locale'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; @@ -59,6 +59,7 @@ export default { }, directives: { GlModalDirective, + GlTooltip: GlTooltipDirective, }, mixins: [glFeatureFlagsMixin()], computed: { @@ -102,27 +103,38 @@ export default { <col v-for="field in scope.fields" :key="field.key" :style="field.customStyle" /> </template> <template #cell(key)="{ item }"> - <div class="d-flex truncated-container"> - <span :id="`ci-variable-key-${item.id}`" class="d-inline-block mw-100 text-truncate">{{ - item.key - }}</span> - <ci-variable-popover - :target="`ci-variable-key-${item.id}`" - :value="item.key" - :tooltip-text="__('Copy key')" + <div class="gl-display-flex truncated-container gl-align-items-center"> + <span + :id="`ci-variable-key-${item.id}`" + class="gl-display-inline-block gl-max-w-full gl-text-truncate" + >{{ item.key }}</span + > + <gl-button + v-gl-tooltip + category="tertiary" + icon="copy-to-clipboard" + :title="__('Copy key')" + :data-clipboard-text="item.key" + :aria-label="__('Copy to clipboard')" /> </div> </template> <template #cell(value)="{ item }"> - <span v-if="valuesHidden">*********************</span> - <div v-else class="d-flex truncated-container"> - <span :id="`ci-variable-value-${item.id}`" class="d-inline-block mw-100 text-truncate">{{ - item.value - }}</span> - <ci-variable-popover - :target="`ci-variable-value-${item.id}`" - :value="item.value" - :tooltip-text="__('Copy value')" + <div class="gl-display-flex gl-align-items-center truncated-container"> + <span v-if="valuesHidden">*********************</span> + <span + v-else + :id="`ci-variable-value-${item.id}`" + class="gl-display-inline-block gl-max-w-full gl-text-truncate" + >{{ item.value }}</span + > + <gl-button + v-gl-tooltip + category="tertiary" + icon="copy-to-clipboard" + :title="__('Copy value')" + :data-clipboard-text="item.value" + :aria-label="__('Copy to clipboard')" /> </div> </template> diff --git a/app/assets/javascripts/vue_shared/components/filtered_search_bar/tokens/base_token.vue b/app/assets/javascripts/vue_shared/components/filtered_search_bar/tokens/base_token.vue index 188aaee0c0d..bbc1888bc0b 100644 --- a/app/assets/javascripts/vue_shared/components/filtered_search_bar/tokens/base_token.vue +++ b/app/assets/javascripts/vue_shared/components/filtered_search_bar/tokens/base_token.vue @@ -10,7 +10,11 @@ import { import { debounce } from 'lodash'; import { DEBOUNCE_DELAY, FILTER_NONE_ANY, OPERATOR_IS_NOT } from '../constants'; -import { getRecentlyUsedSuggestions, setTokenValueToRecentlyUsed } from '../filtered_search_utils'; +import { + getRecentlyUsedSuggestions, + setTokenValueToRecentlyUsed, + stripQuotes, +} from '../filtered_search_utils'; export default { components: { @@ -163,7 +167,14 @@ export default { this.searchKey = data; if (!this.suggestionsLoading && !this.activeTokenValue) { - const search = this.searchTerm ? this.searchTerm : data; + let search = this.searchTerm ? this.searchTerm : data; + + if (search.startsWith('"') && search.endsWith('"')) { + search = stripQuotes(search); + } else if (search.startsWith('"')) { + search = search.slice(1, search.length); + } + this.$emit('fetch-suggestions', search); } }, DEBOUNCE_DELAY), diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 428903a9e75..04dde5ef7b2 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -122,7 +122,7 @@ class ProjectsController < Projects::ApplicationController return redirect_to edit_project_path(@project) end - render_edit + redirect_to edit_project_path(@project) end # rubocop: enable CodeReuse/ActiveRecord diff --git a/doc/administration/geo/replication/updating_the_geo_nodes.md b/doc/administration/geo/replication/updating_the_geo_nodes.md deleted file mode 100644 index f07c8d547a4..00000000000 --- a/doc/administration/geo/replication/updating_the_geo_nodes.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: 'updating_the_geo_sites.md' -remove_date: '2021-11-23' ---- - -This file was moved to [another location](updating_the_geo_sites.md). - -<!-- This redirect file can be deleted after <2021-11-23>. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/api/api_resources.md b/doc/api/api_resources.md index d496ecbca5b..7722dcb92ee 100644 --- a/doc/api/api_resources.md +++ b/doc/api/api_resources.md @@ -42,7 +42,7 @@ The following API resources are available in the project context: | [Events](events.md) | `/projects/:id/events` (also available for users and standalone) | | [Feature Flags](feature_flags.md) | `/projects/:id/feature_flags` | | [Feature Flag User Lists](feature_flag_user_lists.md) | `/projects/:id/feature_flags_user_lists` | -| [Integrations](integrations.md) | `/projects/:id/integrations` | +| [Integrations](integrations.md) (Formerly "services") | `/projects/:id/integrations` | | [Invitations](invitations.md) | `/projects/:id/invitations` (also available for groups) | | [Issues](issues.md) | `/projects/:id/issues` (also available for groups and standalone) | | [Issues Statistics](issues_statistics.md) | `/projects/:id/issues_statistics` (also available for groups and standalone) | @@ -84,7 +84,6 @@ The following API resources are available in the project context: | [Resource label events](resource_label_events.md) | `/projects/:id/issues/.../resource_label_events`, `/projects/:id/merge_requests/.../resource_label_events` (also available for groups) | | [Runners](runners.md) | `/projects/:id/runners` (also available standalone) | | [Search](search.md) | `/projects/:id/search` (also available for groups and standalone) | -| [Services](services.md) (renamed to [Integrations](integrations.md)) | `/projects/:id/services` | | [Tags](tags.md) | `/projects/:id/repository/tags` | | [User-starred metrics dashboards](metrics_user_starred_dashboards.md ) | `/projects/:id/metrics/user_starred_dashboards` | | [Visual Review discussions](visual_review_discussions.md) **(PREMIUM)** | `/projects/:id/merge_requests/:merge_request_id/visual_review_discussions` | diff --git a/doc/api/services.md b/doc/api/services.md deleted file mode 100644 index 7587e53c9db..00000000000 --- a/doc/api/services.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: 'integrations.md' -remove_date: '2021-11-09' ---- - -This file was moved to [another location](integrations.md). - -<!-- This redirect file can be deleted after <2021-11-09>. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/development/background_migrations.md b/doc/development/background_migrations.md index b36c781c16c..4a18b2123da 100644 --- a/doc/development/background_migrations.md +++ b/doc/development/background_migrations.md @@ -165,7 +165,8 @@ big JSON blob) to column `bar` (containing a string). The process for this would roughly be as follows: 1. Release A: - 1. Create a migration class that perform the migration for a row with a given ID. + 1. Create a migration class that performs the migration for a row with a given ID. + You can use [background jobs tracking](#background-jobs-tracking) to simplify cleaning up. 1. Deploy the code for this release, this should include some code that will schedule jobs for newly created data (for example, using an `after_create` hook). 1. Schedule jobs for all existing rows in a post-deployment migration. It's @@ -174,8 +175,10 @@ roughly be as follows: 1. Release B: 1. Deploy code so that the application starts using the new column and stops scheduling jobs for newly created data. - 1. In a post-deployment migration use `finalize_background_migration` from - `BackgroundMigrationHelpers` to ensure no jobs remain. This helper will: + 1. In a post-deployment migration, finalize all jobs that have not succeeded by now. + If you used [background jobs tracking](#background-jobs-tracking) in release A, + you can use `finalize_background_migration` from `BackgroundMigrationHelpers` to ensure no jobs remain. + This helper will: 1. Use `Gitlab::BackgroundMigration.steal` to process any remaining jobs in Sidekiq. 1. Reschedule the migration to be run directly (that is, not through Sidekiq) diff --git a/doc/development/event_tracking/backend.md b/doc/development/event_tracking/backend.md deleted file mode 100644 index 3931f0b35ab..00000000000 --- a/doc/development/event_tracking/backend.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: 'https://about.gitlab.com/handbook/product/product-intelligence-guide/' -remove_date: '2021-12-01' ---- - -This document was moved to [another location](https://about.gitlab.com/handbook/product/product-intelligence-guide/). - -<!-- This redirect file can be deleted after 2021-12-01. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/development/event_tracking/frontend.md b/doc/development/event_tracking/frontend.md deleted file mode 100644 index 3931f0b35ab..00000000000 --- a/doc/development/event_tracking/frontend.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: 'https://about.gitlab.com/handbook/product/product-intelligence-guide/' -remove_date: '2021-12-01' ---- - -This document was moved to [another location](https://about.gitlab.com/handbook/product/product-intelligence-guide/). - -<!-- This redirect file can be deleted after 2021-12-01. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/development/event_tracking/index.md b/doc/development/event_tracking/index.md deleted file mode 100644 index 3931f0b35ab..00000000000 --- a/doc/development/event_tracking/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: 'https://about.gitlab.com/handbook/product/product-intelligence-guide/' -remove_date: '2021-12-01' ---- - -This document was moved to [another location](https://about.gitlab.com/handbook/product/product-intelligence-guide/). - -<!-- This redirect file can be deleted after 2021-12-01. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/development/fe_guide/event_tracking.md b/doc/development/fe_guide/event_tracking.md deleted file mode 100644 index 3931f0b35ab..00000000000 --- a/doc/development/fe_guide/event_tracking.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: 'https://about.gitlab.com/handbook/product/product-intelligence-guide/' -remove_date: '2021-12-01' ---- - -This document was moved to [another location](https://about.gitlab.com/handbook/product/product-intelligence-guide/). - -<!-- This redirect file can be deleted after 2021-12-01. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/development/product_analytics/event_dictionary.md b/doc/development/product_analytics/event_dictionary.md deleted file mode 100644 index 3931f0b35ab..00000000000 --- a/doc/development/product_analytics/event_dictionary.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: 'https://about.gitlab.com/handbook/product/product-intelligence-guide/' -remove_date: '2021-12-01' ---- - -This document was moved to [another location](https://about.gitlab.com/handbook/product/product-intelligence-guide/). - -<!-- This redirect file can be deleted after 2021-12-01. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/development/product_analytics/index.md b/doc/development/product_analytics/index.md deleted file mode 100644 index 3931f0b35ab..00000000000 --- a/doc/development/product_analytics/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: 'https://about.gitlab.com/handbook/product/product-intelligence-guide/' -remove_date: '2021-12-01' ---- - -This document was moved to [another location](https://about.gitlab.com/handbook/product/product-intelligence-guide/). - -<!-- This redirect file can be deleted after 2021-12-01. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/development/service_ping/dictionary.md b/doc/development/service_ping/dictionary.md deleted file mode 100644 index 810c789bc03..00000000000 --- a/doc/development/service_ping/dictionary.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: 'https://metrics.gitlab.com/index.html' -remove_date: '2021-11-10' ---- diff --git a/doc/development/usage_ping/dictionary.md b/doc/development/usage_ping/dictionary.md deleted file mode 100644 index 810c789bc03..00000000000 --- a/doc/development/usage_ping/dictionary.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: 'https://metrics.gitlab.com/index.html' -remove_date: '2021-11-10' ---- diff --git a/doc/install/aws/manual_install_aws.md b/doc/install/aws/manual_install_aws.md index a39983b5bcf..88bb5424451 100644 --- a/doc/install/aws/manual_install_aws.md +++ b/doc/install/aws/manual_install_aws.md @@ -658,12 +658,6 @@ Since we are using the [AWS IAM profile](#create-an-iam-role) we created earlier Remember to run `sudo gitlab-ctl reconfigure` after saving the changes to the `gitlab.rb` file. -NOTE: -One current feature of GitLab that still requires a shared directory (NFS) is -[GitLab Pages](../../user/project/pages/index.md). -There is [work in progress](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/196) -to eliminate the need for NFS to support GitLab Pages. - --- That concludes the configuration changes for our GitLab instance. Next, we'll create a custom AMI based on this instance to use for our launch configuration and auto scaling group. diff --git a/doc/integration/index.md b/doc/integration/index.md index 0b2bf6fde94..61d8547aaf7 100644 --- a/doc/integration/index.md +++ b/doc/integration/index.md @@ -46,7 +46,7 @@ GitLab has integrated with several security partners. For more information, see ## Continuous integration -GitLab can be integrated with the following external service for continuous integration: +GitLab can be integrated with the following external services for continuous integration: - [Jenkins](jenkins.md) CI. - [Datadog](datadog.md), to monitor for CI/CD job failures and performance issues. diff --git a/doc/integration/omniauth.md b/doc/integration/omniauth.md index 8bc111c9a46..dd51d823109 100644 --- a/doc/integration/omniauth.md +++ b/doc/integration/omniauth.md @@ -165,7 +165,7 @@ can disable the entire OmniAuth subsystem by modifying the configuration file: gitlab_rails['omniauth_enabled'] = false ``` -- **For installations from source**: +- **For installations from source** ```yaml omniauth: diff --git a/doc/intro/index.md b/doc/intro/index.md deleted file mode 100644 index af50726e30c..00000000000 --- a/doc/intro/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: '../topics/use_gitlab.md' -remove_date: '2021-12-08' ---- - -This document was moved to [another location](../topics/use_gitlab.md). - -<!-- This redirect file can be deleted after <2021-12-08>. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html --> diff --git a/doc/update/plan_your_upgrade.md b/doc/update/plan_your_upgrade.md index cd2de628234..98549cc136a 100644 --- a/doc/update/plan_your_upgrade.md +++ b/doc/update/plan_your_upgrade.md @@ -145,7 +145,7 @@ version prior to upgrading the application server. If you're using Geo: -- Review [Geo upgrade documentation](../administration/geo/replication/updating_the_geo_nodes.md). +- Review [Geo upgrade documentation](../administration/geo/replication/updating_the_geo_sites.md). - Read about the [Geo version-specific update instructions](../administration/geo/replication/version_specific_updates.md). - Review Geo-specific steps when [updating the database](https://docs.gitlab.com/omnibus/settings/database.html#upgrading-a-geo-instance). - Create an upgrade and rollback plan for _each_ Geo node (primary and each secondary). diff --git a/doc/user/admin_area/approving_users.md b/doc/user/admin_area/approving_users.md deleted file mode 100644 index fdf0c7edfc7..00000000000 --- a/doc/user/admin_area/approving_users.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: 'moderate_users.md' -remove_date: '2021-10-20' ---- - -This document was moved to [another location](moderate_users.md). - -<!-- This redirect file can be deleted after <2021-10-20>. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/user/compliance/compliance_dashboard/index.md b/doc/user/compliance/compliance_dashboard/index.md deleted file mode 100644 index e7f6f908860..00000000000 --- a/doc/user/compliance/compliance_dashboard/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: '../compliance_report/index.md' -remove_date: '2021-10-23' ---- - -This file was moved to [another location](../compliance_report/index.md). - -<!-- This redirect file can be deleted after <2021-10-23>. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/user/infrastructure/mr_integration.md b/doc/user/infrastructure/mr_integration.md deleted file mode 100644 index 81e8f7cbd33..00000000000 --- a/doc/user/infrastructure/mr_integration.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: 'iac/mr_integration.md' -remove_date: '2021-11-26' ---- - -This document was moved to [another location](iac/mr_integration.md). - -<!-- This redirect file can be deleted after <2021-11-26>. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/user/infrastructure/terraform_state.md b/doc/user/infrastructure/terraform_state.md deleted file mode 100644 index e71291d502e..00000000000 --- a/doc/user/infrastructure/terraform_state.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -redirect_to: 'iac/terraform_state.md' -remove_date: '2021-11-26' ---- - -This document was moved to [another location](iac/terraform_state.md). - -<!-- This redirect file can be deleted after <2021-11-26>. --> -<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/user/project/index.md b/doc/user/project/index.md index 78cd2f8fb79..07e8ea1dc06 100644 --- a/doc/user/project/index.md +++ b/doc/user/project/index.md @@ -146,7 +146,7 @@ There are numerous [APIs](../../api/index.md) to use with your projects: - [Markdown](../../api/markdown.md) - [Merge Requests](../../api/merge_requests.md) - [Milestones](../../api/milestones.md) -- [Services](../../api/services.md) +- [Services](../../api/integrations.md) - [Snippets](../../api/project_snippets.md) - [Templates](../../api/project_templates.md) - [Traffic](../../api/project_statistics.md) diff --git a/doc/user/project/integrations/irker.md b/doc/user/project/integrations/irker.md index b96605ff5c9..279b139bacd 100644 --- a/doc/user/project/integrations/irker.md +++ b/doc/user/project/integrations/irker.md @@ -10,7 +10,7 @@ GitLab provides a way to push update messages to an irker server. When configured, pushes to a project trigger the service to send data directly to the irker server. -See also the [irker integration API documentation](../../../api/services.md). +See also the [irker integration API documentation](../../../api/integrations.md). For more information, see the [irker project homepage](https://gitlab.com/esr/irker). diff --git a/lib/gitlab/github_import/parallel_importer.rb b/lib/gitlab/github_import/parallel_importer.rb index f72e595e8e9..a71590c02f8 100644 --- a/lib/gitlab/github_import/parallel_importer.rb +++ b/lib/gitlab/github_import/parallel_importer.rb @@ -35,7 +35,9 @@ module Gitlab def execute Gitlab::Import::SetAsyncJid.set_jid(project.import_state) + # We need to track this job's status for use by Gitlab::GithubImport::RefreshImportJidWorker. Stage::ImportRepositoryWorker + .with_status .perform_async(project.id) true diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb index 950be154096..fd0f9985392 100644 --- a/spec/controllers/projects_controller_spec.rb +++ b/spec/controllers/projects_controller_spec.rb @@ -941,7 +941,7 @@ RSpec.describe ProjectsController do project.reload expect(project.namespace).to eq(new_namespace) - expect(response).to have_gitlab_http_status(:ok) + expect(response).to redirect_to(edit_project_path(project)) end context 'when new namespace is empty' do diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js index 28181e30903..84f0151d9db 100644 --- a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js +++ b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js @@ -14,7 +14,13 @@ import BaseToken from '~/vue_shared/components/filtered_search_bar/tokens/base_t import { mockLabelToken } from '../mock_data'; -jest.mock('~/vue_shared/components/filtered_search_bar/filtered_search_utils'); +jest.mock('~/vue_shared/components/filtered_search_bar/filtered_search_utils', () => ({ + getRecentlyUsedSuggestions: jest.fn(), + setTokenValueToRecentlyUsed: jest.fn(), + stripQuotes: jest.requireActual( + '~/vue_shared/components/filtered_search_bar/filtered_search_utils', + ).stripQuotes, +})); const mockStorageKey = 'recent-tokens-label_name'; @@ -231,6 +237,7 @@ describe('BaseToken', () => { stubs: { Portal: true }, }); }); + it('emits `fetch-suggestions` event on component after a delay when component emits `input` event', async () => { jest.useFakeTimers(); @@ -242,6 +249,32 @@ describe('BaseToken', () => { expect(wrapperWithNoStubs.emitted('fetch-suggestions')).toBeTruthy(); expect(wrapperWithNoStubs.emitted('fetch-suggestions')[2]).toEqual(['foo']); }); + + describe('when search is started with a quote', () => { + it('emits `fetch-suggestions` with filtered value', async () => { + jest.useFakeTimers(); + + wrapperWithNoStubs.find(GlFilteredSearchToken).vm.$emit('input', { data: '"foo' }); + await wrapperWithNoStubs.vm.$nextTick(); + + jest.runAllTimers(); + + expect(wrapperWithNoStubs.emitted('fetch-suggestions')[2]).toEqual(['foo']); + }); + }); + + describe('when search starts and ends with a quote', () => { + it('emits `fetch-suggestions` with filtered value', async () => { + jest.useFakeTimers(); + + wrapperWithNoStubs.find(GlFilteredSearchToken).vm.$emit('input', { data: '"foo"' }); + await wrapperWithNoStubs.vm.$nextTick(); + + jest.runAllTimers(); + + expect(wrapperWithNoStubs.emitted('fetch-suggestions')[2]).toEqual(['foo']); + }); + }); }); }); }); diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/release_token_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/release_token_spec.js index b804ff97b82..b2f246a5985 100644 --- a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/release_token_spec.js +++ b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/release_token_spec.js @@ -8,7 +8,7 @@ import { mockReleaseToken } from '../mock_data'; jest.mock('~/flash'); describe('ReleaseToken', () => { - const id = 123; + const id = '123'; let wrapper; const createComponent = ({ config = mockReleaseToken, value = { data: '' } } = {}) => diff --git a/spec/lib/gitlab/github_import/parallel_importer_spec.rb b/spec/lib/gitlab/github_import/parallel_importer_spec.rb index c7b300ff043..d418e87284d 100644 --- a/spec/lib/gitlab/github_import/parallel_importer_spec.rb +++ b/spec/lib/gitlab/github_import/parallel_importer_spec.rb @@ -27,8 +27,13 @@ RSpec.describe Gitlab::GithubImport::ParallelImporter do before do create(:import_state, :started, project: project) + worker = double(:worker) expect(Gitlab::GithubImport::Stage::ImportRepositoryWorker) + .to receive(:with_status) + .and_return(worker) + + expect(worker) .to receive(:perform_async) .with(project.id) .and_return('123') |