Fix position of duration in both HTML reporters

This commit is contained in:
Steve Gravrock
2025-10-18 09:58:55 -07:00
parent ea882c2f1e
commit 54ac39a192
7 changed files with 68 additions and 42 deletions

View File

@@ -153,7 +153,6 @@ jasmineRequire.HtmlReporter = function(j$) {
jasmineDone(doneResult) {
this.#stateBuilder.jasmineDone(doneResult);
this.#alerts.addDuration(doneResult.totalTime);
this.#banner.showOptionsMenu(this.#config);
if (
@@ -424,10 +423,6 @@ jasmineRequire.AlertsView = function(j$) {
this.rootEl = createDom('div', { className: 'jasmine-alert' });
}
addDuration(ms) {
this.#createAndAdd('jasmine-duration', 'finished in ' + ms / 1000 + 's');
}
addSkipped(numExecuted, numDefined) {
this.#createAndAdd(
'jasmine-bar jasmine-skipped',
@@ -1076,7 +1071,6 @@ jasmineRequire.HtmlReporterV2 = function(j$) {
jasmineDone(doneResult) {
this.#stateBuilder.jasmineDone(doneResult);
this.#progress.rootEl.style.visibility = 'hidden';
this.#alerts.addDuration(doneResult.totalTime);
this.#banner.showOptionsMenu(this.#config);
if (
@@ -1387,26 +1381,44 @@ jasmineRequire.OverallStatusBar = function(j$) {
this.rootEl.classList.add('jasmine-failed');
}
// Replace any existing children with the message
this.rootEl.textContent = statusBarMessage;
const order = doneResult.order;
if (order && order.random) {
this.rootEl.appendChild(
createDom(
'span',
{ className: 'jasmine-seed-bar' },
', randomized with seed ',
createDom(
'a',
{
title: 'randomized with seed ' + order.seed,
href: this.#urlBuilder.seedHref(order.seed)
},
order.seed
)
)
);
this.#addSeedBar(order);
}
this.#addDuration(doneResult);
}
#addSeedBar(order) {
this.rootEl.appendChild(
createDom(
'span',
{ className: 'jasmine-seed-bar' },
', randomized with seed ',
createDom(
'a',
{
title: 'randomized with seed ' + order.seed,
href: this.#urlBuilder.seedHref(order.seed)
},
order.seed
)
)
);
}
#addDuration(doneResult) {
const secs = doneResult.totalTime / 1000;
this.rootEl.appendChild(
createDom(
'span',
{ className: 'jasmine-duration' },
`finished in ${secs}s`
)
);
}
}

View File

@@ -63,6 +63,7 @@ body {
float: right;
line-height: 28px;
padding-right: 9px;
font-size: 11px;
}
.jasmine_html-reporter .jasmine-symbol-summary {
overflow: hidden;