summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-10-11 18:33:02 +0000
committerMike Greiling <mike@pixelcog.com>2018-10-11 18:33:02 +0000
commit80a1bb1d53044df704942a90b8697887c473b96d (patch)
tree910ecbc0a8277318d7069c188cbfa7cec4b68f91
parente5ae0be4381e7ca9a0e226a75132fb77916648a1 (diff)
parentdd0806d095ca481ad2cc3f72feaf3de98cbf093a (diff)
downloadgitlab-ce-80a1bb1d53044df704942a90b8697887c473b96d.tar.gz
Merge branch '52570-erased-block' into 'master'
Fix erased block not being rendered when job was erased Closes #52570 See merge request gitlab-org/gitlab-ce!22294
-rw-r--r--app/assets/javascripts/jobs/components/job_app.vue4
-rw-r--r--changelogs/unreleased/52570-erased-block.yml5
-rw-r--r--spec/features/projects/jobs_spec.rb13
-rw-r--r--spec/javascripts/jobs/components/job_app_spec.js7
4 files changed, 23 insertions, 6 deletions
diff --git a/app/assets/javascripts/jobs/components/job_app.vue b/app/assets/javascripts/jobs/components/job_app.vue
index c149c0ae51e..acf91e2e9ed 100644
--- a/app/assets/javascripts/jobs/components/job_app.vue
+++ b/app/assets/javascripts/jobs/components/job_app.vue
@@ -87,8 +87,8 @@
/>
<erased-block
- v-if="job.erased"
- class="js-job-erased"
+ v-if="job.erased_at"
+ class="js-job-erased-block"
:user="job.erased_by"
:erased-at="job.erased_at"
/>
diff --git a/changelogs/unreleased/52570-erased-block.yml b/changelogs/unreleased/52570-erased-block.yml
new file mode 100644
index 00000000000..6ec295bf81b
--- /dev/null
+++ b/changelogs/unreleased/52570-erased-block.yml
@@ -0,0 +1,5 @@
+---
+title: Fix erased block not being rendered when job was erased
+merge_request: 22294
+author:
+type: fixed
diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb
index 2076ce7b4f7..d981a919fd8 100644
--- a/spec/features/projects/jobs_spec.rb
+++ b/spec/features/projects/jobs_spec.rb
@@ -663,6 +663,19 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
expect(page).to have_content('This job does not have a trace.')
end
end
+
+ context 'with erased job', :js do
+ let(:job) { create(:ci_build, :erased, pipeline: pipeline) }
+
+ it'renders erased job warning' do
+ visit project_job_path(project, job)
+ wait_for_requests
+
+ page.within('.js-job-erased-block') do
+ expect(page).to have_content('Job has been erased')
+ end
+ end
+ end
end
describe "POST /:project/jobs/:id/cancel", :js do
diff --git a/spec/javascripts/jobs/components/job_app_spec.js b/spec/javascripts/jobs/components/job_app_spec.js
index e1cf66e1613..6e0bcf801cd 100644
--- a/spec/javascripts/jobs/components/job_app_spec.js
+++ b/spec/javascripts/jobs/components/job_app_spec.js
@@ -223,7 +223,6 @@ describe('Job App ', () => {
store.dispatch(
'receiveJobSuccess',
Object.assign({}, job, {
- erased: true,
erased_by: {
username: 'root',
web_url: 'gitlab.com/root',
@@ -237,18 +236,18 @@ describe('Job App ', () => {
store,
});
- expect(vm.$el.querySelector('.js-job-erased')).not.toBeNull();
+ expect(vm.$el.querySelector('.js-job-erased-block')).not.toBeNull();
});
it('does not render erased block when `erased` is false', () => {
- store.dispatch('receiveJobSuccess', Object.assign({}, job, { erased: false }));
+ store.dispatch('receiveJobSuccess', Object.assign({}, job, { erased_at: null }));
vm = mountComponentWithStore(Component, {
props,
store,
});
- expect(vm.$el.querySelector('.js-job-erased')).toBeNull();
+ expect(vm.$el.querySelector('.js-job-erased-block')).toBeNull();
});
});