From 1c9607ec332ab9bb04c75439b4671c3868a8e6d9 Mon Sep 17 00:00:00 2001 From: Christian Williams & Kim Eric Mittler Date: Mon, 17 Aug 2009 13:37:33 -0700 Subject: [PATCH] Add a "run all" link. --- lib/TrivialReporter.js | 6 ++++-- lib/jasmine.css | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/TrivialReporter.js b/lib/TrivialReporter.js index 3092dd6..806c545 100644 --- a/lib/TrivialReporter.js +++ b/lib/TrivialReporter.js @@ -30,7 +30,9 @@ jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarA jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) { var suites = runner.getAllSuites(); - this.runnerDiv = this.createDom('div', { className: 'runner running' }, "Running..."); + this.runnerDiv = this.createDom('div', { className: 'runner running' }, + this.createDom('a', { className: 'runSpec', href: '?' }, "run all"), + this.runnerMessageSpan = this.createDom('span', {}, "Running...")); this.document.body.appendChild(this.runnerDiv); for (var i = 0; i < suites.length; i++) { @@ -54,7 +56,7 @@ jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) { var className = (results.failedCount > 0) ? "runner failed" : "runner passed"; this.runnerDiv.setAttribute("class", className); var message = results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s"); - this.runnerDiv.replaceChild(this.document.createTextNode(message), this.runnerDiv.firstChild); + this.runnerMessageSpan.replaceChild(this.document.createTextNode(message), this.runnerDiv.firstChild); }; jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) { diff --git a/lib/jasmine.css b/lib/jasmine.css index 6370d7a..fce53e3 100644 --- a/lib/jasmine.css +++ b/lib/jasmine.css @@ -27,6 +27,7 @@ p { border: 1px outset gray; margin: 5px; padding-left: 1em; + padding-right: 1em; } .runner.running {