summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/ansi2html_spec.rb
diff options
context:
space:
mode:
authorLukas Eipert <leipert@gitlab.com>2019-07-30 12:37:30 +0200
committerLukas Eipert <leipert@gitlab.com>2019-08-02 13:15:24 +0200
commitd1f4d8c7708afa5cbd8f95492e8ec9348bea80e2 (patch)
treed6d6a58cb48e8769ab904ef059695f4d9fc241ac /spec/lib/gitlab/ci/ansi2html_spec.rb
parent5366c89bd62d6305f71566c9ebd0573b3027a349 (diff)
downloadgitlab-ce-d1f4d8c7708afa5cbd8f95492e8ec9348bea80e2.tar.gz
Improve size of rendered job traceleipert-improve-ansi2html
Currently in collapsible job traces _each_ line is wrapped in a span and every line is prepended with another span in order to indent that part of the job log. We are now merging both and fix the CSS in order to show them properly indented. We only had to make sure that before we open a tag, we close the existing ones.
Diffstat (limited to 'spec/lib/gitlab/ci/ansi2html_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/ansi2html_spec.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/spec/lib/gitlab/ci/ansi2html_spec.rb b/spec/lib/gitlab/ci/ansi2html_spec.rb
index 4881ef15eab..eaf06ed8992 100644
--- a/spec/lib/gitlab/ci/ansi2html_spec.rb
+++ b/spec/lib/gitlab/ci/ansi2html_spec.rb
@@ -232,12 +232,11 @@ describe Gitlab::Ci::Ansi2html do
let(:text) { "#{section_start}Some text#{section_end}" }
it 'prints light red' do
- text = "#{section_start}\e[91mHello\e[0m\n#{section_end}"
+ text = "#{section_start}\e[91mHello\e[0m\nLine 1\nLine 2\nLine 3\n#{section_end}"
header = %{<span class="term-fg-l-red section js-section-header section-header js-s-#{class_name(section_name)}">Hello</span>}
line_break = %{<span class="section js-section-header section-header js-s-#{class_name(section_name)}"><br/></span>}
- line = %{<span class="section line s_#{class_name(section_name)}"></span>}
- empty_line = %{<span class="section js-s-#{class_name(section_name)}"></span>}
- html = "#{section_start_html}#{header}#{line_break}#{line}#{empty_line}#{section_end_html}"
+ output_line = %{<span class="section line js-s-#{class_name(section_name)}">Line 1<br/>Line 2<br/>Line 3<br/></span>}
+ html = "#{section_start_html}#{header}#{line_break}#{output_line}#{section_end_html}"
expect(convert_html(text)).to eq(html)
end