Skip to content

Commit

Permalink
Use properly renderable warning status emoji (#277)
Browse files Browse the repository at this point in the history
Fixup spec
  • Loading branch information
andrcuns authored Apr 20, 2022
1 parent 1688412 commit 1a4a614
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion lib/allure_report_publisher/lib/helpers/summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def short_summary
# @return [String]
def status_icon(passed, failed, flaky)
return "➖" if passed.zero? && failed.zero?
return flaky.zero? ? "✅" : "⚠️" if failed.zero?
return flaky.zero? ? "✅" : "" if failed.zero?

"❌"
end
Expand Down
28 changes: 18 additions & 10 deletions spec/allure_report_publisher/helpers/summary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,33 @@
RSpec.describe Publisher::Helpers::Summary, epic: "helpers" do
subject(:summary) { described_class.new(report_path, summary_type) }

let(:status) { "❌" }

context "with expanded summary" do
let(:rows) do
lambda do |table|
[["epic name", 2, 2, 1, 1, "❌"], ["epic name 2", 1, 0, 0, 0, "✅"]].each { |row| table << row }
table << :separator
table << ["Total", 3, 2, 1, 1, "❌"]
end
end

context "with behavior summary" do
let(:summary_type) { Publisher::Helpers::Summary::BEHAVIORS }
let(:status) { "❌" }

let(:rows) do
lambda do |table|
[["epic name", 2, 2, 1, 1, "❌"], ["epic name 2", 1, 0, 0, 0, "✅"]].each { |row| table << row }
table << :separator
table << ["Total", 3, 2, 1, 1, "❌"]
end
end

it_behaves_like "summary fetcher"
end

context "with packages summary" do
let(:summary_type) { Publisher::Helpers::Summary::PACKAGES }
let(:status) { "❗" }

let(:rows) do
lambda do |table|
[["epic name", 4, 0, 1, 0, "✅"], ["epic name 2", 1, 0, 0, 1, "❗"]].each { |row| table << row }
table << :separator
table << ["Total", 5, 0, 1, 1, "❗"]
end
end

it_behaves_like "summary fetcher"
end
Expand Down
17 changes: 6 additions & 11 deletions spec/fixture/fake_report/data/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,17 @@
"children": [
{
"name": "spec",
"status": "passed",
"flaky": false
"status": "passed"
}
]
},
{
"name": "spec",
"status": "failed",
"flaky": true
"status": "passed"
},
{
"name": "spec",
"status": "skipped",
"flaky": false
"status": "skipped"
}
]
},
Expand All @@ -34,13 +31,11 @@
"children": [
{
"name": "spec 3",
"status": "passed",
"flaky": false
"status": "passed"
},
{
"name": "spec 4",
"status": "broken",
"flaky": false
"status": "passed"
}
]
}
Expand All @@ -52,7 +47,7 @@
{
"name": "spec 5",
"status": "passed",
"flaky": false
"flaky": true
}
]
}
Expand Down

0 comments on commit 1a4a614

Please sign in to comment.