TrivialReporter IE compatibility
This commit is contained in:
@@ -19,6 +19,8 @@ jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarA
|
||||
for (var attr in attrs) {
|
||||
if (attr == 'className') {
|
||||
el.setAttribute('class', attrs[attr]);
|
||||
//twice for ie
|
||||
el.setAttribute('className', attrs[attr]);
|
||||
} else {
|
||||
el[attr] = attrs[attr];
|
||||
}
|
||||
@@ -31,14 +33,14 @@ jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
|
||||
var suites = runner.suites();
|
||||
|
||||
this.runnerDiv = this.createDom('div', { className: 'runner running' },
|
||||
this.createDom('a', { className: 'runSpec', href: '?' }, "run all"),
|
||||
this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
|
||||
this.runnerMessageSpan = this.createDom('span', {}, "Running..."));
|
||||
this.document.body.appendChild(this.runnerDiv);
|
||||
|
||||
for (var i = 0; i < suites.length; i++) {
|
||||
var suite = suites[i];
|
||||
var suiteDiv = this.createDom('div', { className: 'suite' },
|
||||
this.createDom('a', { className: 'runSpec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
|
||||
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
|
||||
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
|
||||
this.suiteDivs[suite.getFullName()] = suiteDiv;
|
||||
var parentDiv = this.document.body;
|
||||
@@ -55,6 +57,8 @@ jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
|
||||
var results = runner.results();
|
||||
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
|
||||
this.runnerDiv.setAttribute("class", className);
|
||||
//do it twice for IE
|
||||
this.runnerDiv.setAttribute("className", className);
|
||||
var specs = runner.specs();
|
||||
var specCount = 0;
|
||||
for (var i = 0; i < specs.length; i++) {
|
||||
@@ -83,7 +87,7 @@ jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
|
||||
status = 'skipped';
|
||||
}
|
||||
var specDiv = this.createDom('div', { className: 'spec ' + status },
|
||||
this.createDom('a', { className: 'runSpec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
|
||||
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
|
||||
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, spec.getFullName()));
|
||||
|
||||
|
||||
|
||||
@@ -530,7 +530,7 @@ jasmine.version_= {
|
||||
"major": 0,
|
||||
"minor": 9,
|
||||
"build": 0,
|
||||
"revision": 1255658178
|
||||
"revision": 1255662021
|
||||
};
|
||||
/**
|
||||
* @namespace
|
||||
|
||||
@@ -1,39 +1,27 @@
|
||||
body {
|
||||
font: 14px "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
|
||||
font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
|
||||
}
|
||||
|
||||
h1 {
|
||||
padding-top: 20px;
|
||||
font-weight: bold;
|
||||
font: 24px; /* "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; */
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 5px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.fail {
|
||||
background: url( ../images/fail-16.png ) no-repeat;
|
||||
padding-left: 20px;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.failInSummary {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.runner {
|
||||
border: 1px outset gray;
|
||||
margin: 5px;
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
body .run_spec {
|
||||
float:right;
|
||||
}
|
||||
|
||||
.runner.running {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.runner {
|
||||
border: 1px solid gray;
|
||||
margin: 5px;
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.suite {
|
||||
border: 1px outset gray;
|
||||
margin: 5px;
|
||||
@@ -54,11 +42,11 @@ p {
|
||||
}
|
||||
|
||||
.passed {
|
||||
background-color: lightgreen;
|
||||
background-color: #cfc;
|
||||
}
|
||||
|
||||
.failed {
|
||||
background-color: pink;
|
||||
background-color: #fdd;
|
||||
}
|
||||
|
||||
.skipped {
|
||||
@@ -66,9 +54,9 @@ p {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.resultMessage {
|
||||
white-space: pre;
|
||||
}
|
||||
/*.resultMessage {*/
|
||||
/*white-space: pre;*/
|
||||
/*}*/
|
||||
|
||||
.stackTrace {
|
||||
white-space: pre;
|
||||
@@ -81,10 +69,6 @@ p {
|
||||
background: #eef;
|
||||
}
|
||||
|
||||
.runSpec {
|
||||
margin-left: 5px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#jasmine_content {
|
||||
position:fixed;
|
||||
|
||||
Reference in New Issue
Block a user