diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /spec/features/commits_spec.rb | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) | |
download | gitlab-ce-edaa33dee2ff2f7ea3fac488d41558eb5f86d68c.tar.gz |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'spec/features/commits_spec.rb')
-rw-r--r-- | spec/features/commits_spec.rb | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/spec/features/commits_spec.rb b/spec/features/commits_spec.rb index 4378e88f7c1..e600a99e3b6 100644 --- a/spec/features/commits_spec.rb +++ b/spec/features/commits_spec.rb @@ -30,10 +30,10 @@ RSpec.describe 'Commits' do project.add_reporter(user) end - describe 'Commit builds with jobs_tab_feature flag off' do + describe 'Commit builds with jobs_tab_vue feature flag off' do before do stub_feature_flags(jobs_tab_vue: false) - visit pipeline_path(pipeline) + visit builds_project_pipeline_path(project, pipeline) end it { expect(page).to have_content pipeline.sha[0..7] } @@ -45,6 +45,23 @@ RSpec.describe 'Commits' do end end end + + describe 'Commit builds with jobs_tab_vue feature flag on', :js do + before do + visit builds_project_pipeline_path(project, pipeline) + + wait_for_requests + end + + it { expect(page).to have_content pipeline.sha[0..7] } + + it 'contains generic commit status build' do + page.within('[data-testid="jobs-tab-table"]') do + expect(page).to have_content "##{status.id}" # build id + expect(page).to have_content 'generic' # build name + end + end + end end context 'commit status is Ci Build' do @@ -103,6 +120,18 @@ RSpec.describe 'Commits' do end end + context 'Download artifacts with jobs_tab_vue feature flag on', :js do + before do + create(:ci_job_artifact, :archive, file: artifacts_file, job: build) + end + + it do + visit builds_project_pipeline_path(project, pipeline) + wait_for_requests + expect(page).to have_link('Download artifacts', href: download_project_job_artifacts_path(project, build, file_type: :archive)) + end + end + describe 'Cancel all builds' do it 'cancels commit', :js, :sidekiq_might_not_need_inline do visit pipeline_path(pipeline) @@ -141,6 +170,27 @@ RSpec.describe 'Commits' do end end + context "when logged as reporter and with jobs_tab_vue feature flag on", :js do + before do + project.add_reporter(user) + create(:ci_job_artifact, :archive, file: artifacts_file, job: build) + visit builds_project_pipeline_path(project, pipeline) + wait_for_requests + end + + it 'renders header' do + expect(page).to have_content pipeline.sha[0..7] + expect(page).to have_content pipeline.git_commit_message.gsub!(/\s+/, ' ') + expect(page).to have_content pipeline.user.name + expect(page).not_to have_link('Cancel running') + expect(page).not_to have_link('Retry') + end + + it do + expect(page).to have_link('Download artifacts') + end + end + context 'when accessing internal project with disallowed access', :js, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/299575' do before do project.update!( |