From 0f8eb5c1ba3019083df806b6bee54a38a70aef27 Mon Sep 17 00:00:00 2001 From: Paul Biggar Date: Sun, 31 Jul 2016 18:10:36 -0700 Subject: [PATCH] Add ability to see passed specs via tooltips It's not currently possible to see what specs pass. This adds the description of the spec, as well as all it's parent suites, to a tooltip so you can see what's passing and failing on mouseover. --- spec/atom-reporter.coffee | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/atom-reporter.coffee b/spec/atom-reporter.coffee index c1cf627e5..c8fa136fb 100644 --- a/spec/atom-reporter.coffee +++ b/spec/atom-reporter.coffee @@ -197,6 +197,21 @@ class AtomReporter time = "0#{time}" if time.length < 3 @time.textContent = "#{time[0...-2]}.#{time[-2..]}s" + specTitle: (spec) -> + parentDescs = [] + s = spec.suite + while s + parentDescs.unshift(s.description) + s = s.parentSuite + + suiteString = "" + indent = "" + for desc in parentDescs + suiteString += indent + desc + "\n" + indent += " " + + "#{suiteString} #{indent} it #{spec.description}" + addSpecs: (specs) -> coreSpecs = 0 bundledPackageSpecs = 0 @@ -204,6 +219,7 @@ class AtomReporter for spec in specs symbol = document.createElement('li') symbol.setAttribute('id', "spec-summary-#{spec.id}") + symbol.setAttribute('title', @specTitle(spec)) symbol.className = "spec-summary pending" switch spec.specType when 'core'