Commit cb0616fe authored by Fabio Pitino's avatar Fabio Pitino

Add feature spec for collapsible sections

parent 9f832e59
......@@ -228,6 +228,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,23 @@ describe 'User browses a job', :js do
expect(page).to have_content('Job has been erased')
end
context 'when job trace contains sections' do
let!(:build) { create(:ci_build, :success, :trace_with_sections, :coverage, pipeline: pipeline) }
it 'collapses a section' do
wait_for_requests
text_to_hide = "Cloning into '/nolith/ci-tests'"
expect(page).to have_content(text_to_hide)
expect(page).to have_css('.js-s_get-sources')
find('.js-section-start[data-section="get-sources"]').click
expect(page).not_to have_content(text_to_hide)
expect(page).to have_no_css('.js-s_get-sources')
end
end
context 'with a failed job' do
let!(:build) { create(:ci_build, :failed, :trace_artifact, pipeline: pipeline) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment