Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2024-02-20 03:11:20 +00:00
parent 379ae07f89
commit 1ea1a786c4
28 changed files with 135 additions and 130 deletions

View File

@ -2,21 +2,8 @@
Capybara/TestidFinders: Capybara/TestidFinders:
Exclude: Exclude:
- 'spec/features/merge_request/user_interacts_with_batched_mr_diffs_spec.rb' - 'spec/features/merge_request/user_interacts_with_batched_mr_diffs_spec.rb'
- 'spec/features/projects/pipelines/pipeline_spec.rb'
- 'spec/features/projects/pipelines/pipelines_spec.rb'
- 'spec/features/projects/releases/user_creates_release_spec.rb'
- 'spec/features/projects/releases/user_views_releases_spec.rb'
- 'spec/features/projects/settings/merge_requests_settings_spec.rb'
- 'spec/features/projects/settings/monitor_settings_spec.rb'
- 'spec/features/projects/settings/project_settings_spec.rb'
- 'spec/features/projects/settings/registry_settings_cleanup_tags_spec.rb' - 'spec/features/projects/settings/registry_settings_cleanup_tags_spec.rb'
- 'spec/features/projects/settings/registry_settings_spec.rb' - 'spec/features/projects/settings/registry_settings_spec.rb'
- 'spec/features/projects/settings/repository_settings_spec.rb'
- 'spec/features/projects/settings/secure_files_spec.rb'
- 'spec/features/projects/settings/service_desk_setting_spec.rb'
- 'spec/features/projects/settings/slack_application_spec.rb'
- 'spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb'
- 'spec/features/projects/settings/user_transfers_a_project_spec.rb'
- 'spec/features/projects/show/user_sees_collaboration_links_spec.rb' - 'spec/features/projects/show/user_sees_collaboration_links_spec.rb'
- 'spec/features/projects/sub_group_issuables_spec.rb' - 'spec/features/projects/sub_group_issuables_spec.rb'
- 'spec/features/projects/terraform_spec.rb' - 'spec/features/projects/terraform_spec.rb'

View File

@ -90,6 +90,8 @@ export default {
this.instructWorker(rawTextBlob, language, fileType); this.instructWorker(rawTextBlob, language, fileType);
}, },
handleWorkerMessage({ data }) { handleWorkerMessage({ data }) {
// If the current length of chunks is bigger, it means we've highlighted the whole file already, so nothing to be done here
if (data.length < this.chunks.length) return;
this.chunks = data; this.chunks = data;
this.highlightHash(); // highlight the line if a line number hash is present in the URL this.highlightHash(); // highlight the line if a line number hash is present in the URL
}, },

View File

@ -8,7 +8,7 @@ class NamespaceSetting < ApplicationRecord
ignore_column :project_import_level, remove_with: '16.10', remove_after: '2024-02-22' ignore_column :project_import_level, remove_with: '16.10', remove_after: '2024-02-22'
ignore_column :third_party_ai_features_enabled, remove_with: '16.10', remove_after: '2024-02-22' ignore_column :third_party_ai_features_enabled, remove_with: '16.10', remove_after: '2024-02-22'
ignore_column %i[delayed_project_removal lock_delayed_project_removal], remove_with: '16.10', remove_after: '2024-02-22' ignore_column %i[code suggestions delayed_project_removal lock_delayed_project_removal], remove_with: '16.10', remove_after: '2024-02-22'
cascading_attr :toggle_security_policy_custom_ci cascading_attr :toggle_security_policy_custom_ci
cascading_attr :toggle_security_policies_policy_scope cascading_attr :toggle_security_policies_policy_scope

View File

@ -36,7 +36,6 @@
- if @group.licensed_feature_available?(:group_wikis) - if @group.licensed_feature_available?(:group_wikis)
= render_if_exists 'groups/settings/wiki', f: f, group: @group = render_if_exists 'groups/settings/wiki', f: f, group: @group
= render 'groups/settings/lfs', f: f = render 'groups/settings/lfs', f: f
= render_if_exists 'groups/settings/code_suggestions', f: f, group: @group
= render_if_exists 'groups/settings/security/security_policy_management', f: f, group: @group = render_if_exists 'groups/settings/security/security_policy_management', f: f, group: @group
= render_if_exists 'groups/settings/experimental_settings', f: f, group: @group = render_if_exists 'groups/settings/experimental_settings', f: f, group: @group
= render_if_exists 'groups/settings/product_analytics_settings', f: f, group: @group = render_if_exists 'groups/settings/product_analytics_settings', f: f, group: @group

View File

@ -1,8 +0,0 @@
---
name: ai_assist_flag
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/100500
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/378470
milestone: '15.6'
type: development
group: group::ai framework
default_enabled: false

View File

@ -8,4 +8,4 @@ description: Persists JWT tokens for AI features (e.g. Code Suggestions) to auth
the GitLab instance the GitLab instance
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/125383 introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/125383
milestone: '16.2' milestone: '16.2'
gitlab_schema: gitlab_main gitlab_schema: gitlab_main_clusterwide

View File

@ -64,6 +64,18 @@ For more information about upgrading GitLab Helm Chart, see [the release notes f
packaged GitLab 16.0 and later does not automatically create the directory structure. packaged GitLab 16.0 and later does not automatically create the directory structure.
[Read the issue for more details and the workaround](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8320). [Read the issue for more details and the workaround](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8320).
## 16.9.0
You might encounter the following error while upgrading to GitLab 16.9.0:
```plaintext
PG::UndefinedTable: ERROR: relation "p_ci_pipeline_variables" does not exist
```
Make sure that all migrations complete and restart all Rails and Sidekiq nodes.
A [fix](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/144952) for this bug is
planned for release in 16.9.1.
## 16.8.0 ## 16.8.0
- In GitLab 16.8.0 and 16.8.1, the Sidekiq gem was upgraded, and the newer version requires Redis 6.2 or later. If you are using Redis 6.0, upgrade - In GitLab 16.8.0 and 16.8.1, the Sidekiq gem was upgraded, and the newer version requires Redis 6.2 or later. If you are using Redis 6.0, upgrade

View File

@ -12123,18 +12123,12 @@ msgstr ""
msgid "CodeSuggestions|%{linkStart}Code Suggestions%{linkEnd} uses generative AI to suggest code while you're developing." msgid "CodeSuggestions|%{linkStart}Code Suggestions%{linkEnd} uses generative AI to suggest code while you're developing."
msgstr "" msgstr ""
msgid "CodeSuggestions|%{link_start}What are code suggestions?%{link_end}"
msgstr ""
msgid "CodeSuggestions|A user can be assigned a GitLab Duo Pro seat only once each billable month." msgid "CodeSuggestions|A user can be assigned a GitLab Duo Pro seat only once each billable month."
msgstr "" msgstr ""
msgid "CodeSuggestions|Boost productivity by using %{linkStart}Code Suggestions%{linkEnd} to write and understand code. Starting in February 2024, Code Suggestions will be part of %{duoLinkStart}GitLab Duo Pro%{duoLinkEnd}, available to Premium and Ultimate users for purchase now." msgid "CodeSuggestions|Boost productivity by using %{linkStart}Code Suggestions%{linkEnd} to write and understand code. Starting in February 2024, Code Suggestions will be part of %{duoLinkStart}GitLab Duo Pro%{duoLinkEnd}, available to Premium and Ultimate users for purchase now."
msgstr "" msgstr ""
msgid "CodeSuggestions|Code Suggestions"
msgstr ""
msgid "CodeSuggestions|Enhance your coding experience with intelligent recommendations. %{linkStart}GitLab Duo Pro%{linkEnd} offers features that use generative AI to suggest code." msgid "CodeSuggestions|Enhance your coding experience with intelligent recommendations. %{linkStart}GitLab Duo Pro%{linkEnd} offers features that use generative AI to suggest code."
msgstr "" msgstr ""
@ -12159,12 +12153,6 @@ msgstr ""
msgid "CodeSuggestions|Manage seat assignments for GitLab Duo Pro across your instance." msgid "CodeSuggestions|Manage seat assignments for GitLab Duo Pro across your instance."
msgstr "" msgstr ""
msgid "CodeSuggestions|Projects in this group can use Code Suggestions"
msgstr ""
msgid "CodeSuggestions|Subject to the %{terms_link_start}Testing Terms of Use%{link_end}. Code Suggestions uses third-party AI services."
msgstr ""
msgid "CodeownersValidation|An error occurred while loading the validation errors. Please try again later." msgid "CodeownersValidation|An error occurred while loading the validation errors. Please try again later."
msgstr "" msgstr ""

View File

@ -56,7 +56,7 @@
"@cubejs-client/core": "^0.34.37", "@cubejs-client/core": "^0.34.37",
"@cubejs-client/vue": "^0.34.37", "@cubejs-client/vue": "^0.34.37",
"@floating-ui/dom": "^1.2.9", "@floating-ui/dom": "^1.2.9",
"@gitlab/application-sdk-browser": "^0.3.1", "@gitlab/application-sdk-browser": "^0.3.2",
"@gitlab/at.js": "1.5.7", "@gitlab/at.js": "1.5.7",
"@gitlab/cluster-client": "^2.1.0", "@gitlab/cluster-client": "^2.1.0",
"@gitlab/favicon-overlay": "2.0.0", "@gitlab/favicon-overlay": "2.0.0",

View File

@ -11,7 +11,7 @@ gem 'capybara', '~> 3.39.2'
gem 'capybara-screenshot', '~> 1.0.26' gem 'capybara-screenshot', '~> 1.0.26'
gem 'rake', '~> 13', '>= 13.1.0' gem 'rake', '~> 13', '>= 13.1.0'
gem 'rspec', '~> 3.13' gem 'rspec', '~> 3.13'
gem 'selenium-webdriver', '= 4.17.0' gem 'selenium-webdriver', '= 4.18.1'
gem 'airborne', '~> 0.3.7', require: false # airborne is messing with rspec sandboxed mode so not requiring by default gem 'airborne', '~> 0.3.7', require: false # airborne is messing with rspec sandboxed mode so not requiring by default
gem 'rest-client', '~> 2.1.0' gem 'rest-client', '~> 2.1.0'
gem 'rspec-retry', '~> 0.6.2', require: 'rspec/retry' gem 'rspec-retry', '~> 0.6.2', require: 'rspec/retry'

View File

@ -301,7 +301,7 @@ GEM
sawyer (0.9.2) sawyer (0.9.2)
addressable (>= 2.3.5) addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3) faraday (>= 0.17.3, < 3)
selenium-webdriver (4.17.0) selenium-webdriver (4.18.1)
base64 (~> 0.2) base64 (~> 0.2)
rexml (~> 3.2, >= 3.2.5) rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0) rubyzip (>= 1.2.2, < 3.0)
@ -376,7 +376,7 @@ DEPENDENCIES
rspec-retry (~> 0.6.2) rspec-retry (~> 0.6.2)
rspec_junit_formatter (~> 0.6.0) rspec_junit_formatter (~> 0.6.0)
ruby-debug-ide (~> 0.7.3) ruby-debug-ide (~> 0.7.3)
selenium-webdriver (= 4.17.0) selenium-webdriver (= 4.18.1)
slack-notifier (~> 2.4) slack-notifier (~> 2.4)
terminal-table (~> 3.0.2) terminal-table (~> 3.0.2)
warning (~> 1.3) warning (~> 1.3)

View File

@ -1,4 +1,4 @@
ARG GDK_SHA=dda0a9732d049f4b93c8440555722c6e6fe0398f ARG GDK_SHA=6a9828e36b3f2d66c3f4b5f7cddf1f768d38bbf0
# Use tag prefix when running on 'stable' branch to make sure 'protected' image is used which is not deleted by registry cleanup # Use tag prefix when running on 'stable' branch to make sure 'protected' image is used which is not deleted by registry cleanup
ARG GDK_BASE_TAG_PREFIX ARG GDK_BASE_TAG_PREFIX

View File

@ -89,7 +89,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'shows the pipeline information' do it 'shows the pipeline information' do
visit_pipeline visit_pipeline
within '[data-testid="pipeline-details-header"]' do within_testid 'pipeline-details-header' do
expect(page).to have_content("For #{pipeline.ref}") expect(page).to have_content("For #{pipeline.ref}")
expect(page).to have_content("#{pipeline.statuses.count} Jobs") expect(page).to have_content("#{pipeline.statuses.count} Jobs")
expect(page).to have_link(pipeline.ref, expect(page).to have_link(pipeline.ref,
@ -100,7 +100,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'displays pipeline name instead of commit title' do it 'displays pipeline name instead of commit title' do
visit_pipeline visit_pipeline
within '[data-testid="pipeline-details-header"]' do within_testid 'pipeline-details-header' do
expect(page).to have_content(pipeline.name) expect(page).to have_content(pipeline.name)
expect(page).to have_content(project.commit.short_id) expect(page).to have_content(project.commit.short_id)
expect(page).not_to have_selector('[data-testid="pipeline-commit-title"]') expect(page).not_to have_selector('[data-testid="pipeline-commit-title"]')
@ -115,7 +115,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'displays commit title' do it 'displays commit title' do
visit_pipeline visit_pipeline
within '[data-testid="pipeline-details-header"]' do within_testid 'pipeline-details-header' do
expect(page).to have_content(project.commit.title) expect(page).to have_content(project.commit.title)
expect(page).not_to have_selector('[data-testid="pipeline-name"]') expect(page).not_to have_selector('[data-testid="pipeline-name"]')
end end
@ -140,7 +140,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'shows time ago' do it 'shows time ago' do
visit project_pipeline_path(project, finished_pipeline) visit project_pipeline_path(project, finished_pipeline)
within '[data-testid="pipeline-details-header"]' do within_testid 'pipeline-details-header' do
expect(page).to have_selector('[data-testid="pipeline-finished-time-ago"]') expect(page).to have_selector('[data-testid="pipeline-finished-time-ago"]')
end end
end end
@ -150,7 +150,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'does not show time ago' do it 'does not show time ago' do
visit_pipeline visit_pipeline
within '[data-testid="pipeline-details-header"]' do within_testid 'pipeline-details-header' do
expect(page).not_to have_selector('[data-testid="pipeline-finished-time-ago"]') expect(page).not_to have_selector('[data-testid="pipeline-finished-time-ago"]')
end end
end end
@ -223,7 +223,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
wait_for_requests wait_for_requests
expect(page).not_to have_content('Retry job') expect(page).not_to have_content('Retry job')
within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Running') expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Running')
end end
end end
@ -277,7 +277,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
wait_for_requests wait_for_requests
expect(page).not_to have_content('Retry job') expect(page).not_to have_content('Retry job')
within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Running') expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Running')
end end
end end
@ -311,7 +311,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
wait_for_requests wait_for_requests
expect(page).not_to have_content('Play job') expect(page).not_to have_content('Play job')
within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Running') expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Running')
end end
end end
@ -475,7 +475,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
end end
it 'shows counter in Jobs tab' do it 'shows counter in Jobs tab' do
expect(page.find('[data-testid="builds-counter"]').text).to eq(pipeline.total_size.to_s) expect(find_by_testid('builds-counter').text).to eq(pipeline.total_size.to_s)
end end
context 'without permission to access builds' do context 'without permission to access builds' do
@ -498,7 +498,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
context 'with test reports' do context 'with test reports' do
it 'shows badge counter in Tests tab' do it 'shows badge counter in Tests tab' do
expect(page.find('[data-testid="tests-counter"]').text).to eq(pipeline.test_report_summary.total[:count].to_s) expect(find_by_testid('tests-counter').text).to eq(pipeline.test_report_summary.total[:count].to_s)
end end
it 'calls summary.json endpoint', :js do it 'calls summary.json endpoint', :js do
@ -513,7 +513,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
let(:pipeline) { create(:ci_pipeline, project: project) } let(:pipeline) { create(:ci_pipeline, project: project) }
it 'shows zero' do it 'shows zero' do
expect(page.find('[data-testid="tests-counter"]', visible: :all).text).to eq("0") expect(find_by_testid('tests-counter', visible: :all).text).to eq("0")
end end
end end
end end
@ -527,7 +527,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
context 'when retrying' do context 'when retrying' do
before do before do
find('[data-testid="retry-pipeline"]').click find_by_testid('retry-pipeline').click
wait_for_requests wait_for_requests
end end
@ -536,7 +536,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
end end
it 'shows running status in pipeline header', :sidekiq_might_not_need_inline do it 'shows running status in pipeline header', :sidekiq_might_not_need_inline do
within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Running') expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Running')
end end
end end
@ -606,7 +606,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
end end
it 'does not render render raw HTML to the pipeline ref' do it 'does not render render raw HTML to the pipeline ref' do
page.within '[data-testid="pipeline-details-header"]' do within_testid 'pipeline-details-header' do
expect(page).not_to have_content('<span class="ref-name"') expect(page).not_to have_content('<span class="ref-name"')
end end
end end
@ -632,7 +632,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'shows the pipeline information' do it 'shows the pipeline information' do
visit_pipeline visit_pipeline
within '[data-testid="pipeline-details-header"]' do within_testid 'pipeline-details-header' do
expect(page).to have_content("#{pipeline.statuses.count} Jobs") expect(page).to have_content("#{pipeline.statuses.count} Jobs")
expect(page).to have_content("Related merge request !#{merge_request.iid} " \ expect(page).to have_content("Related merge request !#{merge_request.iid} " \
"to merge #{merge_request.source_branch}") "to merge #{merge_request.source_branch}")
@ -651,7 +651,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'does not link to the source branch commit path' do it 'does not link to the source branch commit path' do
visit_pipeline visit_pipeline
within '[data-testid="pipeline-details-header"]' do within_testid 'pipeline-details-header' do
expect(page).not_to have_link(merge_request.source_branch) expect(page).not_to have_link(merge_request.source_branch)
expect(page).to have_content(merge_request.source_branch) expect(page).to have_content(merge_request.source_branch)
end end
@ -666,7 +666,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
end end
it 'shows the pipeline information', :sidekiq_might_not_need_inline do it 'shows the pipeline information', :sidekiq_might_not_need_inline do
within '[data-testid="pipeline-details-header"]' do within_testid 'pipeline-details-header' do
expect(page).to have_content("#{pipeline.statuses.count} Jobs") expect(page).to have_content("#{pipeline.statuses.count} Jobs")
expect(page).to have_content("Related merge request !#{merge_request.iid} " \ expect(page).to have_content("Related merge request !#{merge_request.iid} " \
"to merge #{merge_request.source_branch}") "to merge #{merge_request.source_branch}")
@ -703,7 +703,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'shows the pipeline information' do it 'shows the pipeline information' do
visit_pipeline visit_pipeline
within '[data-testid="pipeline-details-header"]' do within_testid 'pipeline-details-header' do
expect(page).to have_content("#{pipeline.statuses.count} Jobs") expect(page).to have_content("#{pipeline.statuses.count} Jobs")
expect(page).to have_content("Related merge request !#{merge_request.iid} " \ expect(page).to have_content("Related merge request !#{merge_request.iid} " \
"to merge #{merge_request.source_branch} " \ "to merge #{merge_request.source_branch} " \
@ -725,7 +725,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'does not link to the target branch commit path' do it 'does not link to the target branch commit path' do
visit_pipeline visit_pipeline
within '[data-testid="pipeline-details-header"]' do within_testid 'pipeline-details-header' do
expect(page).not_to have_link(merge_request.target_branch) expect(page).not_to have_link(merge_request.target_branch)
expect(page).to have_content(merge_request.target_branch) expect(page).to have_content(merge_request.target_branch)
end end
@ -740,7 +740,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
end end
it 'shows the pipeline information', :sidekiq_might_not_need_inline do it 'shows the pipeline information', :sidekiq_might_not_need_inline do
within '[data-testid="pipeline-details-header"]' do within_testid 'pipeline-details-header' do
expect(page).to have_content("#{pipeline.statuses.count} Jobs") expect(page).to have_content("#{pipeline.statuses.count} Jobs")
expect(page).to have_content("Related merge request !#{merge_request.iid} " \ expect(page).to have_content("Related merge request !#{merge_request.iid} " \
"to merge #{merge_request.source_branch} " \ "to merge #{merge_request.source_branch} " \
@ -899,7 +899,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'shows deploy job as created' do it 'shows deploy job as created' do
subject subject
within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Pending') expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Pending')
end end
@ -924,7 +924,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'shows deploy job as pending' do it 'shows deploy job as pending' do
subject subject
within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Running') expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Running')
end end
@ -953,7 +953,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'shows deploy job as waiting for resource' do it 'shows deploy job as waiting for resource' do
subject subject
within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Waiting') expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Waiting')
end end
@ -973,7 +973,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'shows deploy job as pending' do it 'shows deploy job as pending' do
subject subject
within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Running') expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Running')
end end
@ -1001,7 +1001,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'shows deploy job as waiting for resource' do it 'shows deploy job as waiting for resource' do
subject subject
within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Waiting') expect(page).to have_selector('[data-testid="ci-icon"]', text: 'Waiting')
end end
@ -1048,7 +1048,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
end end
it 'shows counter in Jobs tab' do it 'shows counter in Jobs tab' do
expect(page.find('[data-testid="builds-counter"]').text).to eq(pipeline.total_size.to_s) expect(find_by_testid('builds-counter').text).to eq(pipeline.total_size.to_s)
end end
end end
@ -1057,7 +1057,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
context 'when retrying' do context 'when retrying' do
before do before do
find('[data-testid="retry"]', match: :first).click find_by_testid('retry', match: :first).click
end end
it 'does not show a "Retry" button', :sidekiq_might_not_need_inline do it 'does not show a "Retry" button', :sidekiq_might_not_need_inline do
@ -1082,7 +1082,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
context 'playing manual job' do context 'playing manual job' do
before do before do
within '[data-testid="jobs-tab-table"]' do within_testid 'jobs-tab-table' do
click_button('Play') click_button('Play')
wait_for_requests wait_for_requests
@ -1094,7 +1094,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
context 'when user unschedules a delayed job' do context 'when user unschedules a delayed job' do
before do before do
within '[data-testid="jobs-tab-table"]' do within_testid 'jobs-tab-table' do
click_button('Unschedule') click_button('Unschedule')
end end
end end
@ -1141,7 +1141,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'shows retry button for failed build' do it 'shows retry button for failed build' do
subject subject
page.within(find('[data-testid="tab-failures"]', match: :first)) do within_testid('tab-failures', match: :first) do
expect(page).not_to have_button('Retry') expect(page).not_to have_button('Retry')
end end
end end
@ -1155,7 +1155,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'shows retry button for failed build' do it 'shows retry button for failed build' do
subject subject
page.within(find('[data-testid="tab-failures"]', match: :first)) do within_testid('tab-failures', match: :first) do
expect(page).to have_button('Retry') expect(page).to have_button('Retry')
end end
end end
@ -1270,7 +1270,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
end end
it 'contains badge that indicates it is the latest build' do it 'contains badge that indicates it is the latest build' do
page.within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_content 'latest' expect(page).to have_content 'latest'
end end
end end
@ -1293,7 +1293,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
end end
it 'contains badge that indicates errors' do it 'contains badge that indicates errors' do
page.within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_content 'yaml invalid' expect(page).to have_content 'yaml invalid'
end end
end end
@ -1301,7 +1301,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'contains badge with tooltip which contains error' do it 'contains badge with tooltip which contains error' do
expect(pipeline).to have_yaml_errors expect(pipeline).to have_yaml_errors
page.within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_selector( expect(page).to have_selector(
%(span[title="#{pipeline.yaml_errors}"])) %(span[title="#{pipeline.yaml_errors}"]))
end end
@ -1314,7 +1314,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
it 'contains badge with tooltip which contains failure reason' do it 'contains badge with tooltip which contains failure reason' do
expect(pipeline.failure_reason?).to eq true expect(pipeline.failure_reason?).to eq true
page.within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_selector( expect(page).to have_selector(
%(span[title="#{pipeline.present.failure_reason}"])) %(span[title="#{pipeline.present.failure_reason}"]))
end end
@ -1332,7 +1332,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
end end
it 'contains badge that indicates being stuck' do it 'contains badge that indicates being stuck' do
page.within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_content 'stuck' expect(page).to have_content 'stuck'
end end
end end
@ -1358,7 +1358,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
end end
it 'contains badge that indicates using auto devops' do it 'contains badge that indicates using auto devops' do
page.within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_content 'Auto DevOps' expect(page).to have_content 'Auto DevOps'
end end
end end
@ -1394,7 +1394,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do
end end
it 'contains badge that indicates detached merge request pipeline' do it 'contains badge that indicates detached merge request pipeline' do
page.within('[data-testid="pipeline-details-header"]') do within_testid('pipeline-details-header') do
expect(page).to have_content 'merge request' expect(page).to have_content 'merge request'
end end
end end

View File

@ -367,7 +367,7 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do
# Wait for UI to transition to ensure a request has been made # Wait for UI to transition to ensure a request has been made
within(manual_action_dropdown) { find('.gl-spinner') } within(manual_action_dropdown) { find('.gl-spinner') }
within(manual_action_dropdown) { find('[data-testid="play-icon"]') } within(manual_action_dropdown) { find_by_testid('play-icon') }
wait_for_requests wait_for_requests
end end
@ -574,7 +574,9 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do
find_by_testid('ci-action-button').click find_by_testid('ci-action-button').click
wait_for_requests wait_for_requests
expect(find('[data-testid="mini-pipeline-graph-dropdown-toggle"][aria-expanded="true"]')).to be_visible element = find_by_testid('mini-pipeline-graph-dropdown-toggle')
expect(element['aria-expanded']).to eq "true"
expect(element).to be_visible
end end
end end
end end
@ -725,7 +727,7 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do
it 'creates a new pipeline' do it 'creates a new pipeline' do
expect do expect do
find('[data-testid="run-pipeline-button"]', text: 'Run pipeline').click find_by_testid('run-pipeline-button', text: 'Run pipeline').click
wait_for_requests wait_for_requests
end end
.to change { Ci::Pipeline.count }.by(1) .to change { Ci::Pipeline.count }.by(1)
@ -735,13 +737,13 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do
context 'when variables are specified' do context 'when variables are specified' do
it 'creates a new pipeline with variables' do it 'creates a new pipeline with variables' do
page.within(find("[data-testid='ci-variable-row-container']")) do within_testid('ci-variable-row-container') do
find("[data-testid='pipeline-form-ci-variable-key-field']").set('key_name') find_by_testid('pipeline-form-ci-variable-key-field').set('key_name')
find("[data-testid='pipeline-form-ci-variable-value-field']").set('value') find_by_testid('pipeline-form-ci-variable-value-field').set('value')
end end
expect do expect do
find('[data-testid="run-pipeline-button"]', text: 'Run pipeline').click find_by_testid('run-pipeline-button', text: 'Run pipeline').click
wait_for_requests wait_for_requests
end end
.to change { Ci::Pipeline.count }.by(1) .to change { Ci::Pipeline.count }.by(1)
@ -754,7 +756,7 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do
context 'without gitlab-ci.yml' do context 'without gitlab-ci.yml' do
before do before do
find('[data-testid="run-pipeline-button"]', text: 'Run pipeline').click find_by_testid('run-pipeline-button', text: 'Run pipeline').click
wait_for_requests wait_for_requests
end end
@ -764,7 +766,7 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do
stub_ci_pipeline_to_return_yaml_file stub_ci_pipeline_to_return_yaml_file
expect do expect do
find('[data-testid="run-pipeline-button"]', text: 'Run pipeline').click find_by_testid('run-pipeline-button', text: 'Run pipeline').click
wait_for_requests wait_for_requests
end end
.to change { Ci::Pipeline.count }.by(1) .to change { Ci::Pipeline.count }.by(1)
@ -795,7 +797,7 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do
it 'increments jobs_cache_index' do it 'increments jobs_cache_index' do
click_button 'Clear runner caches' click_button 'Clear runner caches'
wait_for_requests wait_for_requests
expect(page.find('[data-testid="alert-info"]')).to have_content 'Project cache successfully reset.' expect(find_by_testid('alert-info')).to have_content 'Project cache successfully reset.'
end end
end end
@ -803,7 +805,7 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do
it 'sets jobs_cache_index to 1' do it 'sets jobs_cache_index to 1' do
click_button 'Clear runner caches' click_button 'Clear runner caches'
wait_for_requests wait_for_requests
expect(page.find('[data-testid="alert-info"]')).to have_content 'Project cache successfully reset.' expect(find_by_testid('alert-info')).to have_content 'Project cache successfully reset.'
end end
end end
end end

View File

@ -38,7 +38,9 @@ RSpec.describe 'User creates release', :js, feature_category: :continuous_delive
select_new_tag_name(tag_name) select_new_tag_name(tag_name)
expect(page).to have_button(project.default_branch) expect(page).to have_button(project.default_branch)
expect(page.find('[data-testid="create-from-field"] .ref-selector button')).to have_content(project.default_branch) within_testid('create-from-field') do
expect(page.find('.ref-selector button')).to have_content(project.default_branch)
end
end end
context 'when the "Save release" button is clicked' do context 'when the "Save release" button is clicked' do
@ -115,7 +117,7 @@ RSpec.describe 'User creates release', :js, feature_category: :continuous_delive
end end
it 'renders a preview of the release notes markdown' do it 'renders a preview of the release notes markdown' do
within('[data-testid="release-notes"]') do within_testid('release-notes') do
expect(page).to have_text('some markdown content') expect(page).to have_text('some markdown content')
end end
end end

View File

@ -86,8 +86,8 @@ RSpec.describe 'User views releases', :js, feature_category: :continuous_deliver
context 'sorting' do context 'sorting' do
def sort_page(by:, direction:) def sort_page(by:, direction:)
within '[data-testid="releases-sort"]' do within_testid 'releases-sort' do
find('[data-testid="base-dropdown-toggle"]').click find_by_testid('base-dropdown-toggle').click
find('li.gl-new-dropdown-item', text: by).click find('li.gl-new-dropdown-item', text: by).click

View File

@ -61,7 +61,7 @@ RSpec.describe 'Projects > Settings > Merge requests', feature_category: :code_r
end end
end end
find('[data-testid="project-features-save-button"]').send_keys(:return) find_by_testid('project-features-save-button').send_keys(:return)
visit project_settings_merge_requests_path(project) visit project_settings_merge_requests_path(project)
@ -88,7 +88,7 @@ RSpec.describe 'Projects > Settings > Merge requests', feature_category: :code_r
end end
end end
find('[data-testid="project-features-save-button"]').send_keys(:return) find_by_testid('project-features-save-button').send_keys(:return)
visit project_settings_merge_requests_path(project) visit project_settings_merge_requests_path(project)
@ -146,7 +146,7 @@ RSpec.describe 'Projects > Settings > Merge requests', feature_category: :code_r
end end
end end
find('[data-testid="project-features-save-button"]').send_keys(:return) find_by_testid('project-features-save-button').send_keys(:return)
visit project_settings_merge_requests_path(project) visit project_settings_merge_requests_path(project)

View File

@ -59,13 +59,13 @@ RSpec.describe 'Projects > Settings > For a forked project', :js, feature_catego
end end
def click_settings_tab def click_settings_tab
within '[data-testid="alert-integration-settings"]' do within_testid 'alert-integration-settings' do
click_link 'Alert settings' click_link 'Alert settings'
end end
end end
def save_form def save_form
page.within '[data-testid="alert-integration-settings"]' do within_testid 'alert-integration-settings' do
click_button 'Save changes' click_button 'Save changes'
end end

View File

@ -47,7 +47,7 @@ RSpec.describe 'Projects settings', feature_category: :groups_and_projects do
# disable by clicking toggle # disable by clicking toggle
forking_enabled_button.click forking_enabled_button.click
page.within('.sharing-permissions') do page.within('.sharing-permissions') do
find('[data-testid="project-features-save-button"]').click find_by_testid('project-features-save-button').click
end end
wait_for_requests wait_for_requests
@ -77,7 +77,7 @@ RSpec.describe 'Projects settings', feature_category: :groups_and_projects do
expect(default_award_emojis_input.value).to eq('false') expect(default_award_emojis_input.value).to eq('false')
page.within('.sharing-permissions') do page.within('.sharing-permissions') do
find('[data-testid="project-features-save-button"]').click find_by_testid('project-features-save-button').click
end end
wait_for_requests wait_for_requests

View File

@ -35,7 +35,7 @@ RSpec.describe 'Project > Settings > Packages and registries > Container registr
expect(find('.breadcrumbs')).to have_content('Cleanup policies') expect(find('.breadcrumbs')).to have_content('Cleanup policies')
section = find('[data-testid="container-expiration-policy-project-settings"]') section = find_by_testid('container-expiration-policy-project-settings')
expect(section).to have_text 'Cleanup policies' expect(section).to have_text 'Cleanup policies'
end end
@ -45,20 +45,20 @@ RSpec.describe 'Project > Settings > Packages and registries > Container registr
wait_for_requests wait_for_requests
expect(page).to be_axe_clean.within('[data-testid="container-expiration-policy-project-settings"]') expect(page).to be_axe_clean.within('[data-testid="container-expiration-policy-project-settings"]')
.skipping :'link-in-text-block', :'heading-order' .skipping :'link-in-text-block', :'heading-order' # rubocop:todo Capybara/TestidFinders -- Doesn't cover use case, see https://gitlab.com/gitlab-org/gitlab/-/issues/442224
end end
it 'saves cleanup policy submit the form' do it 'saves cleanup policy submit the form' do
subject subject
within '[data-testid="container-expiration-policy-project-settings"]' do within_testid 'container-expiration-policy-project-settings' do
select('Every day', from: 'Run cleanup') select('Every day', from: 'Run cleanup')
select('50 tags per image name', from: 'Keep the most recent:') select('50 tags per image name', from: 'Keep the most recent:')
fill_in('Keep tags matching:', with: 'stable') fill_in('Keep tags matching:', with: 'stable')
select('7 days', from: 'Remove tags older than:') select('7 days', from: 'Remove tags older than:')
fill_in('Remove tags matching:', with: '.*-production') fill_in('Remove tags matching:', with: '.*-production')
submit_button = find('[data-testid="save-button"') submit_button = find_by_testid('save-button')
expect(submit_button).not_to be_disabled expect(submit_button).not_to be_disabled
submit_button.click submit_button.click
end end
@ -70,10 +70,10 @@ RSpec.describe 'Project > Settings > Packages and registries > Container registr
it 'does not save cleanup policy submit form with invalid regex' do it 'does not save cleanup policy submit form with invalid regex' do
subject subject
within '[data-testid="container-expiration-policy-project-settings"]' do within_testid 'container-expiration-policy-project-settings' do
fill_in('Remove tags matching:', with: '*-production') fill_in('Remove tags matching:', with: '*-production')
submit_button = find('[data-testid="save-button"') submit_button = find_by_testid('save-button')
expect(submit_button).not_to be_disabled expect(submit_button).not_to be_disabled
submit_button.click submit_button.click
end end
@ -95,8 +95,8 @@ RSpec.describe 'Project > Settings > Packages and registries > Container registr
it 'displays the related section' do it 'displays the related section' do
subject subject
within '[data-testid="container-expiration-policy-project-settings"]' do within_testid 'container-expiration-policy-project-settings' do
expect(find('[data-testid="enable-toggle"]')) expect(find_by_testid('enable-toggle'))
.to have_content('Disabled - Tags will not be automatically deleted.') .to have_content('Disabled - Tags will not be automatically deleted.')
end end
end end
@ -110,7 +110,7 @@ RSpec.describe 'Project > Settings > Packages and registries > Container registr
it 'does not display the related section' do it 'does not display the related section' do
subject subject
within '[data-testid="container-expiration-policy-project-settings"]' do within_testid 'container-expiration-policy-project-settings' do
expect(find('.gl-alert-title')).to have_content('Cleanup policy for tags is disabled') expect(find('.gl-alert-title')).to have_content('Cleanup policy for tags is disabled')
end end
end end

View File

@ -27,7 +27,7 @@ RSpec.describe 'Project > Settings > Packages and registries > Container registr
wait_for_requests wait_for_requests
expect(page).to be_axe_clean.within('[data-testid="packages-and-registries-project-settings"]') expect(page).to be_axe_clean.within('[data-testid="packages-and-registries-project-settings"]')
.skipping :'heading-order' .skipping :'heading-order' # rubocop:todo Capybara/TestidFinders -- Doesn't cover use case, see https://gitlab.com/gitlab-org/gitlab/-/issues/442224
end end
it 'shows active tab on sidebar' do it 'shows active tab on sidebar' do
@ -42,7 +42,7 @@ RSpec.describe 'Project > Settings > Packages and registries > Container registr
it 'shows available section' do it 'shows available section' do
subject subject
settings_block = find('[data-testid="container-expiration-policy-project-settings"]') settings_block = find_by_testid('container-expiration-policy-project-settings')
expect(settings_block).to have_text 'Cleanup policies' expect(settings_block).to have_text 'Cleanup policies'
end end
@ -66,7 +66,7 @@ RSpec.describe 'Project > Settings > Packages and registries > Container registr
it 'displays the related section' do it 'displays the related section' do
subject subject
within '[data-testid="container-expiration-policy-project-settings"]' do within_testid 'container-expiration-policy-project-settings' do
expect(page).to have_link('Set cleanup rules', href: cleanup_image_tags_project_settings_packages_and_registries_path(project)) expect(page).to have_link('Set cleanup rules', href: cleanup_image_tags_project_settings_packages_and_registries_path(project))
end end
end end
@ -80,7 +80,7 @@ RSpec.describe 'Project > Settings > Packages and registries > Container registr
it 'does not display the related section' do it 'does not display the related section' do
subject subject
within '[data-testid="container-expiration-policy-project-settings"]' do within_testid 'container-expiration-policy-project-settings' do
expect(find('.gl-alert-title')).to have_content('Cleanup policy for tags is disabled') expect(find('.gl-alert-title')).to have_content('Cleanup policy for tags is disabled')
end end
end end

View File

@ -98,7 +98,9 @@ RSpec.describe 'Projects > Settings > Repository settings', feature_category: :s
project.deploy_keys << private_deploy_key project.deploy_keys << private_deploy_key
visit project_settings_repository_path(project) visit project_settings_repository_path(project)
find('.deploy-key', text: private_deploy_key.title).find('[data-testid="pencil-icon"]').click within('.deploy-key', text: private_deploy_key.title) do
find_by_testid('pencil-icon').click
end
fill_in 'deploy_key_title', with: 'updated_deploy_key' fill_in 'deploy_key_title', with: 'updated_deploy_key'
check 'deploy_key_deploy_keys_projects_attributes_0_can_push' check 'deploy_key_deploy_keys_projects_attributes_0_can_push'
@ -112,7 +114,9 @@ RSpec.describe 'Projects > Settings > Repository settings', feature_category: :s
project.deploy_keys << public_deploy_key project.deploy_keys << public_deploy_key
visit project_settings_repository_path(project) visit project_settings_repository_path(project)
find('.deploy-key', text: public_deploy_key.title).find('[data-testid="pencil-icon"]').click within('.deploy-key', text: public_deploy_key.title) do
find_by_testid('pencil-icon').click
end
check 'deploy_key_deploy_keys_projects_attributes_0_can_push' check 'deploy_key_deploy_keys_projects_attributes_0_can_push'
click_button 'Save changes' click_button 'Save changes'
@ -130,7 +134,9 @@ RSpec.describe 'Projects > Settings > Repository settings', feature_category: :s
find('.js-deployKeys-tab-available_project_keys').click find('.js-deployKeys-tab-available_project_keys').click
find('.deploy-key', text: private_deploy_key.title).find('[data-testid="pencil-icon"]').click within('.deploy-key', text: private_deploy_key.title) do
find_by_testid('pencil-icon').click
end
fill_in 'deploy_key_title', with: 'updated_deploy_key' fill_in 'deploy_key_title', with: 'updated_deploy_key'
click_button 'Save changes' click_button 'Save changes'

View File

@ -46,7 +46,7 @@ RSpec.describe 'Secure Files', :js, feature_category: :source_code_management do
within '#js-secure-files' do within '#js-secure-files' do
expect(page).to have_content(file.name) expect(page).to have_content(file.name)
find('[data-testid="delete-button"]').click find_by_testid('delete-button').click
end end
expect(page).to have_content("Delete #{file.name}?") expect(page).to have_content("Delete #{file.name}?")

View File

@ -39,7 +39,7 @@ RSpec.describe 'Service Desk Setting', :js, :clean_gitlab_redis_cache, feature_c
project.reload project.reload
expect(project.service_desk_enabled).to be_truthy expect(project.service_desk_enabled).to be_truthy
expect(project.service_desk_address).to be_present expect(project.service_desk_address).to be_present
expect(find('[data-testid="incoming-email"]').value).to eq(project.service_desk_incoming_address) expect(find_by_testid('incoming-email').value).to eq(project.service_desk_incoming_address)
end end
end end
@ -56,7 +56,7 @@ RSpec.describe 'Service Desk Setting', :js, :clean_gitlab_redis_cache, feature_c
wait_for_requests wait_for_requests
project.reload project.reload
expect(find('[data-testid="incoming-email"]').value).to eq(project.service_desk_alias_address) expect(find_by_testid('incoming-email').value).to eq(project.service_desk_alias_address)
page.within '#js-service-desk' do page.within '#js-service-desk' do
fill_in('service-desk-project-suffix', with: 'foo') fill_in('service-desk-project-suffix', with: 'foo')
@ -65,7 +65,7 @@ RSpec.describe 'Service Desk Setting', :js, :clean_gitlab_redis_cache, feature_c
wait_for_requests wait_for_requests
expect(find('[data-testid="incoming-email"]').value).to eq('address-suffix@example.com') expect(find_by_testid('incoming-email').value).to eq('address-suffix@example.com')
end end
describe 'issue description templates' do describe 'issue description templates' do

View File

@ -55,7 +55,7 @@ RSpec.describe 'Projects > Settings > User manages merge request settings', feat
visit edit_project_path(project) visit edit_project_path(project)
find('.project-feature-controls[data-for="project[project_feature_attributes][merge_requests_access_level]"] .gl-toggle').click find('.project-feature-controls[data-for="project[project_feature_attributes][merge_requests_access_level]"] .gl-toggle').click
find('[data-testid="project-features-save-button"]').send_keys(:return) find_by_testid('project-features-save-button').send_keys(:return)
visit project_settings_merge_requests_path(project) visit project_settings_merge_requests_path(project)
@ -76,7 +76,7 @@ RSpec.describe 'Projects > Settings > User manages merge request settings', feat
visit edit_project_path(project) visit edit_project_path(project)
find('.project-feature-controls[data-for="project[project_feature_attributes][builds_access_level]"] .gl-toggle').click find('.project-feature-controls[data-for="project[project_feature_attributes][builds_access_level]"] .gl-toggle').click
find('[data-testid="project-features-save-button"]').send_keys(:return) find_by_testid('project-features-save-button').send_keys(:return)
visit project_settings_merge_requests_path(project) visit project_settings_merge_requests_path(project)
@ -100,7 +100,7 @@ RSpec.describe 'Projects > Settings > User manages merge request settings', feat
within('.sharing-permissions-form') do within('.sharing-permissions-form') do
find('.project-feature-controls[data-for="project[project_feature_attributes][merge_requests_access_level]"] .gl-toggle').click find('.project-feature-controls[data-for="project[project_feature_attributes][merge_requests_access_level]"] .gl-toggle').click
find('[data-testid="project-features-save-button"]').send_keys(:return) find_by_testid('project-features-save-button').send_keys(:return)
end end
visit project_settings_merge_requests_path(project) visit project_settings_merge_requests_path(project)

View File

@ -18,10 +18,10 @@ RSpec.describe 'Projects > Settings > User transfers a project', :js, feature_ca
visit edit_project_path(project) visit edit_project_path(project)
page.within('.js-project-transfer-form') do page.within('.js-project-transfer-form') do
page.find('[data-testid="transfer-project-namespace"]').click find_by_testid('transfer-project-namespace').click
end end
page.within('[data-testid="transfer-project-namespace"]') do within_testid('transfer-project-namespace') do
page.find("li button", text: group.full_name).click page.find("li button", text: group.full_name).click
end end

View File

@ -1,6 +1,7 @@
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import axios from 'axios'; import axios from 'axios';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { nextTick } from 'vue';
import { splitIntoChunks } from '~/vue_shared/components/source_viewer/workers/highlight_utils'; import { splitIntoChunks } from '~/vue_shared/components/source_viewer/workers/highlight_utils';
import highlightMixin from '~/repository/mixins/highlight_mixin'; import highlightMixin from '~/repository/mixins/highlight_mixin';
import LineHighlighter from '~/blob/line_highlighter'; import LineHighlighter from '~/blob/line_highlighter';
@ -111,6 +112,20 @@ describe('HighlightMixin', () => {
it('highlights hash', () => { it('highlights hash', () => {
expect(lineHighlighter.highlightHash).toHaveBeenCalledWith(hash); expect(lineHighlighter.highlightHash).toHaveBeenCalledWith(hash);
}); });
describe('when order of events are incorrect', () => {
it('renders the correct data', async () => {
const chunk1 = { highlightedContent: 'chunk 1 content' };
const chunk2 = { highlightedContent: 'chunk 2 content' };
workerMock.onmessage({ data: [chunk1, chunk2] });
workerMock.onmessage({ data: [chunk2] });
await nextTick();
expect(wrapper.text()).toBe(chunk1.highlightedContent);
});
});
}); });
describe('LFS blobs', () => { describe('LFS blobs', () => {

View File

@ -1263,10 +1263,10 @@
resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.1.tgz#16308cea045f0fc777b6ff20a9f25474dd8293d2" resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.1.tgz#16308cea045f0fc777b6ff20a9f25474dd8293d2"
integrity sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q== integrity sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==
"@gitlab/application-sdk-browser@^0.3.1": "@gitlab/application-sdk-browser@^0.3.2":
version "0.3.1" version "0.3.2"
resolved "https://registry.yarnpkg.com/@gitlab/application-sdk-browser/-/application-sdk-browser-0.3.1.tgz#1eaf8838c48417223bcecbb19bf262c6c6d88d8e" resolved "https://registry.yarnpkg.com/@gitlab/application-sdk-browser/-/application-sdk-browser-0.3.2.tgz#6cf08d9d0aaaaff97a5041c7503b915802e2991a"
integrity sha512-I7IDm5yvVDAqi9/GlOfDSJBpxrAoJxs0A8dHQNIXZ+y5r66i259cW+laWfDiq40td/SFNjONjVs0PWBflkuoSQ== integrity sha512-R7LQxJB329KJRQ7pyvewcJ4gDI1uGRhpHaN7f3cB33VGBFKvL2ffyz5PlNMOEhYpHs1kSPLX9grNhgkvuyaBWg==
dependencies: dependencies:
"@snowplow/browser-plugin-client-hints" "^3.9.0" "@snowplow/browser-plugin-client-hints" "^3.9.0"
"@snowplow/browser-plugin-error-tracking" "^3.9.0" "@snowplow/browser-plugin-error-tracking" "^3.9.0"