From bf2adf55ebf25386b0a2bfe0323a14d4fe02b575 Mon Sep 17 00:00:00 2001 From: Sheel Choksi Date: Sun, 28 Apr 2013 21:27:51 -0700 Subject: [PATCH] Add titles to specs in HtmlReporter Each spec symbol contains a title, which is the full name of the spec it represents. [Finishes #48420677] --- lib/jasmine-core/jasmine-html.js | 3 ++- spec/html/HtmlReporterSpec.js | 3 ++- src/html/HtmlReporter.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/jasmine-core/jasmine-html.js b/lib/jasmine-core/jasmine-html.js index dcc89137..b250d87c 100644 --- a/lib/jasmine-core/jasmine-html.js +++ b/lib/jasmine-core/jasmine-html.js @@ -87,7 +87,8 @@ jasmine.HtmlReporter = function(options) { symbols.appendChild(createDom("li", { className: result.status, - id: "spec_" + result.id} + id: "spec_" + result.id, + title: result.fullName} )); if (result.status == "failed") { diff --git a/spec/html/HtmlReporterSpec.js b/spec/html/HtmlReporterSpec.js index bdbdccb4..48dc58d4 100644 --- a/spec/html/HtmlReporterSpec.js +++ b/spec/html/HtmlReporterSpec.js @@ -46,12 +46,13 @@ describe("New HtmlReporter", function() { }); reporter.initialize(); - reporter.specDone({id: 789, status: "disabled"}); + reporter.specDone({id: 789, status: "disabled", fullName: "symbols should have titles"}); var statuses = container.getElementsByClassName('symbol-summary')[0]; var specEl = statuses.getElementsByTagName('li')[0]; expect(specEl.getAttribute("class")).toEqual("disabled"); expect(specEl.getAttribute("id")).toEqual("spec_789"); + expect(specEl.getAttribute("title")).toEqual("symbols should have titles"); }); it("reports the status symbol of a pending spec", function() { diff --git a/src/html/HtmlReporter.js b/src/html/HtmlReporter.js index 6d2cef47..1f9c32be 100644 --- a/src/html/HtmlReporter.js +++ b/src/html/HtmlReporter.js @@ -65,7 +65,8 @@ jasmine.HtmlReporter = function(options) { symbols.appendChild(createDom("li", { className: result.status, - id: "spec_" + result.id} + id: "spec_" + result.id, + title: result.fullName} )); if (result.status == "failed") {