Commit 2464a45c authored by Kev's avatar Kev

Add test for section options

parent ed13174f
...@@ -329,6 +329,32 @@ RSpec.describe Gitlab::Ci::Ansi2json do ...@@ -329,6 +329,32 @@ RSpec.describe Gitlab::Ci::Ansi2json do
]) ])
end end
end end
context 'with section options' do
let(:option_section_start) { "section_start:#{section_start_time.to_i}:#{section_name}[collapsed=true,unused_option=123]\r\033[0K"}
it 'provides section options when set' do
trace = "#{option_section_start}hello#{section_end}"
expect(convert_json(trace)).to eq([
{
offset: 0,
content: [{ text: "hello" }],
section: 'prepare-script',
section_header: true,
section_options: {
'collapsed' => 'true',
'unused_option' => '123'
}
},
{
offset: 83,
content: [],
section: 'prepare-script',
section_duration: '01:03'
}
])
end
end
end end
describe 'incremental updates' do describe 'incremental updates' do
......
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