提交 13268ba6 编写于 作者: F Fabio Pitino

Extract shared examples for duplicate sections and non

上级 81848b63
......@@ -238,6 +238,16 @@ FactoryBot.define do
end
end
trait :trace_with_sections do
after(:create) do |build, evaluator|
trace = File.binread(
File.expand_path(
Rails.root.join('spec/fixtures/trace/trace_with_sections')))
build.trace.set(trace)
end
end
trait :unicode_trace_live do
after(:create) do |build, evaluator|
trace = File.binread(
......
......@@ -34,6 +34,34 @@ describe 'User browses a job', :js do
expect(page).to have_content('Job has been erased')
end
shared_examples 'has collapsible sections' do
it 'collapses the section clicked' do
wait_for_requests
text_to_hide = "Cloning into '/nolith/ci-tests'"
text_to_show = 'Waiting for pod'
expect(page).to have_content(text_to_hide)
expect(page).to have_content(text_to_show)
first('.js-section-start[data-section="get-sources"]').click
expect(page).not_to have_content(text_to_hide)
expect(page).to have_content(text_to_show)
end
end
context 'when job trace contains sections' do
let!(:build) { create(:ci_build, :success, :trace_with_sections, :coverage, pipeline: pipeline) }
it_behaves_like 'has collapsible sections'
end
context 'when job trace contains duplicate sections' do
let!(:build) { create(:ci_build, :success, :trace_with_duplicate_sections, :coverage, pipeline: pipeline) }
it_behaves_like 'has collapsible sections'
end
context 'when job trace contains sections' do
let!(:build) { create(:ci_build, :success, :trace_with_duplicate_sections, :coverage, pipeline: pipeline) }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册