Merge branch 'unique-css-classes' of https://github.com/prather-mcs/jasmine into prather-mcs-unique-css-classes
This commit is contained in:
@@ -25,19 +25,19 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
this.initialize = function() {
|
||||
clearPrior();
|
||||
htmlReporterMain = createDom('div', {className: 'jasmine_html-reporter'},
|
||||
createDom('div', {className: 'banner'},
|
||||
createDom('a', {className: 'title', href: 'http://jasmine.github.io/', target: '_blank'}),
|
||||
createDom('span', {className: 'version'}, j$.version)
|
||||
createDom('div', {className: 'jasmine-banner'},
|
||||
createDom('a', {className: 'jasmine-title', href: 'http://jasmine.github.io/', target: '_blank'}),
|
||||
createDom('span', {className: 'jasmine-version'}, j$.version)
|
||||
),
|
||||
createDom('ul', {className: 'symbol-summary'}),
|
||||
createDom('div', {className: 'alert'}),
|
||||
createDom('div', {className: 'results'},
|
||||
createDom('div', {className: 'failures'})
|
||||
createDom('ul', {className: 'jasmine-symbol-summary'}),
|
||||
createDom('div', {className: 'jasmine-alert'}),
|
||||
createDom('div', {className: 'jasmine-results'},
|
||||
createDom('div', {className: 'jasmine-failures'})
|
||||
)
|
||||
);
|
||||
getContainer().appendChild(htmlReporterMain);
|
||||
|
||||
symbols = find('.symbol-summary');
|
||||
symbols = find('.jasmine-symbol-summary');
|
||||
};
|
||||
|
||||
var totalSpecsDefined;
|
||||
@@ -46,7 +46,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
timer.start();
|
||||
};
|
||||
|
||||
var summary = createDom('div', {className: 'summary'});
|
||||
var summary = createDom('div', {className: 'jasmine-summary'});
|
||||
|
||||
var topResults = new j$.ResultsNode({}, '', null),
|
||||
currentParent = topResults;
|
||||
@@ -83,7 +83,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
}
|
||||
|
||||
symbols.appendChild(createDom('li', {
|
||||
className: noExpectations(result) ? 'empty' : result.status,
|
||||
className: noExpectations(result) ? 'jasmine-empty' : 'jasmine-' + result.status,
|
||||
id: 'spec_' + result.id,
|
||||
title: result.fullName
|
||||
}
|
||||
@@ -93,18 +93,18 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
failureCount++;
|
||||
|
||||
var failure =
|
||||
createDom('div', {className: 'spec-detail failed'},
|
||||
createDom('div', {className: 'description'},
|
||||
createDom('div', {className: 'jasmine-spec-detail jasmine-failed'},
|
||||
createDom('div', {className: 'jasmine-description'},
|
||||
createDom('a', {title: result.fullName, href: specHref(result)}, result.fullName)
|
||||
),
|
||||
createDom('div', {className: 'messages'})
|
||||
createDom('div', {className: 'jasmine-messages'})
|
||||
);
|
||||
var messages = failure.childNodes[1];
|
||||
|
||||
for (var i = 0; i < result.failedExpectations.length; i++) {
|
||||
var expectation = result.failedExpectations[i];
|
||||
messages.appendChild(createDom('div', {className: 'result-message'}, expectation.message));
|
||||
messages.appendChild(createDom('div', {className: 'stack-trace'}, expectation.stack));
|
||||
messages.appendChild(createDom('div', {className: 'jasmine-result-message'}, expectation.message));
|
||||
messages.appendChild(createDom('div', {className: 'jasmine-stack-trace'}, expectation.stack));
|
||||
}
|
||||
|
||||
failures.push(failure);
|
||||
@@ -116,70 +116,70 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
};
|
||||
|
||||
this.jasmineDone = function() {
|
||||
var banner = find('.banner');
|
||||
var alert = find('.alert');
|
||||
alert.appendChild(createDom('span', {className: 'duration'}, 'finished in ' + timer.elapsed() / 1000 + 's'));
|
||||
var banner = find('.jasmine-banner');
|
||||
var alert = find('.jasmine-alert');
|
||||
alert.appendChild(createDom('span', {className: 'jasmine-duration'}, 'finished in ' + timer.elapsed() / 1000 + 's'));
|
||||
|
||||
banner.appendChild(
|
||||
createDom('div', { className: 'run-options' },
|
||||
createDom('span', { className: 'trigger' }, 'Options'),
|
||||
createDom('div', { className: 'payload' },
|
||||
createDom('div', { className: 'exceptions' },
|
||||
createDom('div', { className: 'jasmine-run-options' },
|
||||
createDom('span', { className: 'jasmine-trigger' }, 'Options'),
|
||||
createDom('div', { className: 'jasmine-payload' },
|
||||
createDom('div', { className: 'jasmine-exceptions' },
|
||||
createDom('input', {
|
||||
className: 'raise',
|
||||
id: 'raise-exceptions',
|
||||
className: 'jasmine-raise',
|
||||
id: 'jasmine-raise-exceptions',
|
||||
type: 'checkbox'
|
||||
}),
|
||||
createDom('label', { className: 'label', 'for': 'raise-exceptions' }, 'raise exceptions')),
|
||||
createDom('div', { className: 'throw-failures' },
|
||||
createDom('label', { className: 'jasmine-label', 'for': 'jasmine-raise-exceptions' }, 'raise exceptions')),
|
||||
createDom('div', { className: 'jasmine-throw-failures' },
|
||||
createDom('input', {
|
||||
className: 'throw',
|
||||
id: 'throw-failures',
|
||||
className: 'jasmine-throw',
|
||||
id: 'jasmine-throw-failures',
|
||||
type: 'checkbox'
|
||||
}),
|
||||
createDom('label', { className: 'label', 'for': 'throw-failures' }, 'stop spec on expectation failure'))
|
||||
createDom('label', { className: 'jasmine-label', 'for': 'jasmine-throw-failures' }, 'stop spec on expectation failure'))
|
||||
)
|
||||
));
|
||||
|
||||
var raiseCheckbox = find('#raise-exceptions');
|
||||
var raiseCheckbox = find('#jasmine-raise-exceptions');
|
||||
|
||||
raiseCheckbox.checked = !env.catchingExceptions();
|
||||
raiseCheckbox.onclick = onRaiseExceptionsClick;
|
||||
|
||||
var throwCheckbox = find('#throw-failures');
|
||||
var throwCheckbox = find('#jasmine-throw-failures');
|
||||
throwCheckbox.checked = env.throwingExpectationFailures();
|
||||
throwCheckbox.onclick = onThrowExpectationsClick;
|
||||
|
||||
var optionsMenu = find('.run-options'),
|
||||
optionsTrigger = optionsMenu.querySelector('.trigger'),
|
||||
optionsPayload = optionsMenu.querySelector('.payload'),
|
||||
isOpen = /\bopen\b/;
|
||||
var optionsMenu = find('.jasmine-run-options'),
|
||||
optionsTrigger = optionsMenu.querySelector('.jasmine-trigger'),
|
||||
optionsPayload = optionsMenu.querySelector('.jasmine-payload'),
|
||||
isOpen = /\bjasmine-open\b/;
|
||||
|
||||
optionsTrigger.onclick = function() {
|
||||
if (isOpen.test(optionsPayload.className)) {
|
||||
optionsPayload.className = optionsPayload.className.replace(isOpen, '');
|
||||
} else {
|
||||
optionsPayload.className += ' open';
|
||||
optionsPayload.className += ' jasmine-open';
|
||||
}
|
||||
};
|
||||
|
||||
if (specsExecuted < totalSpecsDefined) {
|
||||
var skippedMessage = 'Ran ' + specsExecuted + ' of ' + totalSpecsDefined + ' specs - run all';
|
||||
alert.appendChild(
|
||||
createDom('span', {className: 'bar skipped'},
|
||||
createDom('span', {className: 'jasmine-bar jasmine-skipped'},
|
||||
createDom('a', {href: '?', title: 'Run all specs'}, skippedMessage)
|
||||
)
|
||||
);
|
||||
}
|
||||
var statusBarMessage = '';
|
||||
var statusBarClassName = 'bar ';
|
||||
var statusBarClassName = 'jasmine-bar ';
|
||||
|
||||
if (totalSpecsDefined > 0) {
|
||||
statusBarMessage += pluralize('spec', specsExecuted) + ', ' + pluralize('failure', failureCount);
|
||||
if (pendingSpecCount) { statusBarMessage += ', ' + pluralize('pending spec', pendingSpecCount); }
|
||||
statusBarClassName += (failureCount > 0) ? 'failed' : 'passed';
|
||||
statusBarClassName += (failureCount > 0) ? 'jasmine-failed' : 'jasmine-passed';
|
||||
} else {
|
||||
statusBarClassName += 'skipped';
|
||||
statusBarClassName += 'jasmine-skipped';
|
||||
statusBarMessage += 'No specs found';
|
||||
}
|
||||
|
||||
@@ -189,12 +189,12 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
var failedSuite = failedSuites[i];
|
||||
for(var j = 0; j < failedSuite.failedExpectations.length; j++) {
|
||||
var errorBarMessage = 'AfterAll ' + failedSuite.failedExpectations[j].message;
|
||||
var errorBarClassName = 'bar errored';
|
||||
var errorBarClassName = 'jasmine-bar jasmine-errored';
|
||||
alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessage));
|
||||
}
|
||||
}
|
||||
|
||||
var results = find('.results');
|
||||
var results = find('.jasmine-results');
|
||||
results.appendChild(summary);
|
||||
|
||||
summaryList(topResults, summary);
|
||||
@@ -204,8 +204,8 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
for (var i = 0; i < resultsTree.children.length; i++) {
|
||||
var resultNode = resultsTree.children[i];
|
||||
if (resultNode.type == 'suite') {
|
||||
var suiteListNode = createDom('ul', {className: 'suite', id: 'suite-' + resultNode.result.id},
|
||||
createDom('li', {className: 'suite-detail'},
|
||||
var suiteListNode = createDom('ul', {className: 'jasmine-suite', id: 'suite-' + resultNode.result.id},
|
||||
createDom('li', {className: 'jasmine-suite-detail'},
|
||||
createDom('a', {href: specHref(resultNode.result)}, resultNode.result.description)
|
||||
)
|
||||
);
|
||||
@@ -214,8 +214,8 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
domParent.appendChild(suiteListNode);
|
||||
}
|
||||
if (resultNode.type == 'spec') {
|
||||
if (domParent.getAttribute('class') != 'specs') {
|
||||
specListNode = createDom('ul', {className: 'specs'});
|
||||
if (domParent.getAttribute('class') != 'jasmine-specs') {
|
||||
specListNode = createDom('ul', {className: 'jasmine-specs'});
|
||||
domParent.appendChild(specListNode);
|
||||
}
|
||||
var specDescription = resultNode.result.description;
|
||||
@@ -227,7 +227,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
}
|
||||
specListNode.appendChild(
|
||||
createDom('li', {
|
||||
className: resultNode.result.status,
|
||||
className: 'jasmine-' + resultNode.result.status,
|
||||
id: 'spec-' + resultNode.result.id
|
||||
},
|
||||
createDom('a', {href: specHref(resultNode.result)}, specDescription)
|
||||
@@ -239,24 +239,24 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
|
||||
if (failures.length) {
|
||||
alert.appendChild(
|
||||
createDom('span', {className: 'menu bar spec-list'},
|
||||
createDom('span', {className: 'jasmine-menu jasmine-bar jasmine-spec-list'},
|
||||
createDom('span', {}, 'Spec List | '),
|
||||
createDom('a', {className: 'failures-menu', href: '#'}, 'Failures')));
|
||||
createDom('a', {className: 'jasmine-failures-menu', href: '#'}, 'Failures')));
|
||||
alert.appendChild(
|
||||
createDom('span', {className: 'menu bar failure-list'},
|
||||
createDom('a', {className: 'spec-list-menu', href: '#'}, 'Spec List'),
|
||||
createDom('span', {className: 'jasmine-menu jasmine-bar jasmine-failure-list'},
|
||||
createDom('a', {className: 'jasmine-spec-list-menu', href: '#'}, 'Spec List'),
|
||||
createDom('span', {}, ' | Failures ')));
|
||||
|
||||
find('.failures-menu').onclick = function() {
|
||||
setMenuModeTo('failure-list');
|
||||
find('.jasmine-failures-menu').onclick = function() {
|
||||
setMenuModeTo('jasmine-failure-list');
|
||||
};
|
||||
find('.spec-list-menu').onclick = function() {
|
||||
setMenuModeTo('spec-list');
|
||||
find('.jasmine-spec-list-menu').onclick = function() {
|
||||
setMenuModeTo('jasmine-spec-list');
|
||||
};
|
||||
|
||||
setMenuModeTo('failure-list');
|
||||
setMenuModeTo('jasmine-failure-list');
|
||||
|
||||
var failureNode = find('.failures');
|
||||
var failureNode = find('.jasmine-failures');
|
||||
for (var i = 0; i < failures.length; i++) {
|
||||
failureNode.appendChild(failures[i]);
|
||||
}
|
||||
|
||||
@@ -46,23 +46,23 @@ body {
|
||||
line-height: $line-height;
|
||||
}
|
||||
|
||||
.banner,
|
||||
.symbol-summary,
|
||||
.summary,
|
||||
.result-message,
|
||||
.spec .description,
|
||||
.spec-detail .description,
|
||||
.alert .bar,
|
||||
.stack-trace {
|
||||
.jasmine-banner,
|
||||
.jasmine-symbol-summary,
|
||||
.jasmine-summary,
|
||||
.jasmine-result-message,
|
||||
.jasmine-spec .jasmine-description,
|
||||
.jasmine-spec-detail .jasmine-description,
|
||||
.jasmine-alert .jasmine-bar,
|
||||
.jasmine-stack-trace {
|
||||
padding-left: $margin-unit - 5px;
|
||||
padding-right: $margin-unit - 5px;
|
||||
}
|
||||
|
||||
.banner {
|
||||
.jasmine-banner {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.banner .title {
|
||||
.jasmine-banner .jasmine-title {
|
||||
background: inline-image('jasmine-horizontal.png') no-repeat;
|
||||
background: inline-image('jasmine-horizontal.svg') no-repeat, none;
|
||||
@include background-size(100%);
|
||||
@@ -72,7 +72,7 @@ body {
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
.banner .version {
|
||||
.jasmine-banner .jasmine-version {
|
||||
margin-left: $margin-unit;
|
||||
position: relative;
|
||||
top: 6px;
|
||||
@@ -85,17 +85,17 @@ body {
|
||||
right: 100%;
|
||||
}
|
||||
|
||||
.version {
|
||||
.jasmine-version {
|
||||
color: $faint-text-color;
|
||||
}
|
||||
|
||||
//--- Banner ---//
|
||||
|
||||
.banner {
|
||||
.jasmine-banner {
|
||||
margin-top: $line-height;
|
||||
}
|
||||
|
||||
.duration {
|
||||
.jasmine-duration {
|
||||
color: #fff;
|
||||
float: right;
|
||||
line-height: $line-height * 2;
|
||||
@@ -104,7 +104,7 @@ body {
|
||||
|
||||
//--- Symbol summary ---//
|
||||
|
||||
.symbol-summary {
|
||||
.jasmine-symbol-summary {
|
||||
@include clearfix;
|
||||
margin: $line-height 0;
|
||||
|
||||
@@ -115,7 +115,7 @@ body {
|
||||
|
||||
font-size: 16px;
|
||||
|
||||
&.passed {
|
||||
&.jasmine-passed {
|
||||
font-size: 14px;
|
||||
|
||||
&:before {
|
||||
@@ -124,7 +124,7 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
&.failed {
|
||||
&.jasmine-failed {
|
||||
line-height: ($line-height / 2) + 2;
|
||||
|
||||
&:before {
|
||||
@@ -135,7 +135,7 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
&.jasmine-disabled {
|
||||
font-size: 14px;
|
||||
|
||||
&:before {
|
||||
@@ -144,7 +144,7 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
&.pending {
|
||||
&.jasmine-pending {
|
||||
line-height: 17px;
|
||||
&:before {
|
||||
color: $pending-color;
|
||||
@@ -152,7 +152,7 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
&.empty {
|
||||
&.jasmine-empty {
|
||||
font-size: 14px;
|
||||
|
||||
&:before {
|
||||
@@ -163,7 +163,7 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
.run-options {
|
||||
.jasmine-run-options {
|
||||
float: right;
|
||||
margin-right: 5px;
|
||||
border: 1px solid $jasmine-color;
|
||||
@@ -171,12 +171,12 @@ body {
|
||||
position: relative;
|
||||
line-height: 20px;
|
||||
|
||||
.trigger {
|
||||
.jasmine-trigger {
|
||||
cursor: pointer;
|
||||
padding: 8px 16px;
|
||||
}
|
||||
|
||||
.payload {
|
||||
.jasmine-payload {
|
||||
position: absolute;
|
||||
display: none;
|
||||
right: -1px;
|
||||
@@ -185,7 +185,7 @@ body {
|
||||
white-space: nowrap;
|
||||
padding: 4px 8px;
|
||||
|
||||
&.open {
|
||||
&.jasmine-open {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
@@ -193,30 +193,30 @@ body {
|
||||
|
||||
//--- Alerts: status bars ---//
|
||||
|
||||
.bar {
|
||||
.jasmine-bar {
|
||||
line-height: $line-height * 2;
|
||||
font-size: $large-font-size;
|
||||
|
||||
display: block;
|
||||
color: #eee;
|
||||
|
||||
&.failed {
|
||||
&.jasmine-failed {
|
||||
background-color: $failing-color;
|
||||
}
|
||||
|
||||
&.passed {
|
||||
&.jasmine-passed {
|
||||
background-color: $passing-color;
|
||||
}
|
||||
|
||||
&.skipped {
|
||||
&.jasmine-skipped {
|
||||
background-color: $neutral-color;
|
||||
}
|
||||
|
||||
&.errored {
|
||||
&.jasmine-errored {
|
||||
background-color: $failing-color;
|
||||
}
|
||||
|
||||
&.menu {
|
||||
&.jasmine-menu {
|
||||
background-color: #fff;
|
||||
color: $faint-text-color;
|
||||
|
||||
@@ -231,29 +231,29 @@ body {
|
||||
}
|
||||
|
||||
// simplify toggle control between the two menu bars
|
||||
&.spec-list {
|
||||
.bar.menu.failure-list,
|
||||
.results .failures {
|
||||
&.jasmine-spec-list {
|
||||
.jasmine-bar.jasmine-menu.jasmine-failure-list,
|
||||
.jasmine-results .jasmine-failures {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&.failure-list {
|
||||
.bar.menu.spec-list,
|
||||
.summary {
|
||||
&.jasmine-failure-list {
|
||||
.jasmine-bar.jasmine-menu.jasmine-spec-list,
|
||||
.jasmine-summary {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
//--- Results ---//
|
||||
|
||||
.results {
|
||||
.jasmine-results {
|
||||
margin-top: $line-height;
|
||||
}
|
||||
|
||||
//--- Results summary: Suites and Specs names/links ---//
|
||||
|
||||
.summary {
|
||||
.jasmine-summary {
|
||||
margin-top: $margin-unit;
|
||||
|
||||
ul {
|
||||
@@ -262,40 +262,40 @@ body {
|
||||
padding-top: 0;
|
||||
padding-left: 0;
|
||||
|
||||
&.suite {
|
||||
&.jasmine-suite {
|
||||
margin-top: $margin-unit/2;
|
||||
margin-bottom: $margin-unit/2
|
||||
}
|
||||
}
|
||||
|
||||
li {
|
||||
&.passed a {
|
||||
&.jasmine-passed a {
|
||||
color: $passing-color;
|
||||
}
|
||||
|
||||
&.failed a {
|
||||
&.jasmine-failed a {
|
||||
color: $failing-color;
|
||||
}
|
||||
|
||||
&.empty a {
|
||||
&.jasmine-empty a {
|
||||
color: $pending-color;
|
||||
}
|
||||
|
||||
&.pending a {
|
||||
&.jasmine-pending a {
|
||||
color: $pending-color;
|
||||
}
|
||||
|
||||
&.disabled a {
|
||||
&.jasmine-disabled a {
|
||||
color: $neutral-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.description+.suite {
|
||||
.jasmine-description + .jasmine-suite {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.suite {
|
||||
.jasmine-suite {
|
||||
margin-top: $margin-unit;
|
||||
|
||||
a {
|
||||
@@ -305,11 +305,11 @@ body {
|
||||
|
||||
//--- Failure details ---//
|
||||
|
||||
.failures {
|
||||
.spec-detail {
|
||||
.jasmine-failures {
|
||||
.jasmine-spec-detail {
|
||||
margin-bottom: $line-height * 2;
|
||||
|
||||
.description {
|
||||
.jasmine-description {
|
||||
background-color: $failing-color;
|
||||
|
||||
a {
|
||||
@@ -319,7 +319,7 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
.result-message {
|
||||
.jasmine-result-message {
|
||||
padding-top: $line-height;
|
||||
|
||||
color: $text-color;
|
||||
@@ -327,11 +327,11 @@ body {
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.result-message span.result {
|
||||
.jasmine-result-message span.jasmine-result {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.stack-trace {
|
||||
.jasmine-stack-trace {
|
||||
margin: 5px 0 0 0;
|
||||
max-height: $line-height * 16;
|
||||
overflow: auto;
|
||||
|
||||
Reference in New Issue
Block a user