1
jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
6
this.symbol = this.createDom('li', { className: 'pending' });
7
this.dom.symbolSummary.appendChild(this.symbol);
9
this.summary = this.createDom('div', { className: 'specSummary' },
11
className: 'description',
12
href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
13
title: this.spec.getFullName()
14
}, this.spec.description)
17
this.detail = this.createDom('div', { className: 'specDetail' },
19
className: 'description',
20
href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
21
title: this.spec.getFullName()
22
}, this.spec.getFullName())
26
jasmine.HtmlReporter.SpecView.prototype.status = function() {
27
return this.getSpecStatus(this.spec);
30
jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
31
this.symbol.className = this.status();
33
switch (this.status()) {
38
this.appendSummaryToSuiteDiv();
42
this.appendSummaryToSuiteDiv();
43
this.appendFailureDetail();
48
jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
49
this.summary.className += ' ' + this.status();
50
this.appendToSummary(this.spec, this.summary);
53
jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
54
this.detail.className += ' ' + this.status();
56
var resultItems = this.spec.results().getItems();
57
var messagesDiv = this.createDom('div', { className: 'messages' });
59
for (var i = 0; i < resultItems.length; i++) {
60
var result = resultItems[i];
62
if (result.type == 'log') {
63
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
64
} else if (result.type == 'expect' && result.passed && !result.passed()) {
65
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
67
if (result.trace.stack) {
68
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
73
if (messagesDiv.childNodes.length > 0) {
74
this.detail.appendChild(messagesDiv);
75
this.dom.details.appendChild(this.detail);
79
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);