Make AlertsView#add private

This commit is contained in:
Steve Gravrock
2025-10-15 19:37:18 -07:00
parent 695a805844
commit 4dfc34a7a0
2 changed files with 16 additions and 18 deletions

View File

@@ -418,11 +418,11 @@ jasmineRequire.AlertsView = function(j$) {
} }
addDuration(ms) { addDuration(ms) {
this.add('jasmine-duration', 'finished in ' + ms / 1000 + 's'); this.#add('jasmine-duration', 'finished in ' + ms / 1000 + 's');
} }
addSkipped(numExecuted, numDefined) { addSkipped(numExecuted, numDefined) {
this.add( this.#add(
'jasmine-bar jasmine-skipped', 'jasmine-bar jasmine-skipped',
createDom( createDom(
'a', 'a',
@@ -454,18 +454,18 @@ jasmineRequire.AlertsView = function(j$) {
return false; return false;
}; };
this.add('jasmine-menu jasmine-bar jasmine-spec-list', [ this.#add('jasmine-menu jasmine-bar jasmine-spec-list', [
createDom('span', {}, 'Spec List | '), createDom('span', {}, 'Spec List | '),
failuresLink failuresLink
]); ]);
this.add('jasmine-menu jasmine-bar jasmine-failure-list', [ this.#add('jasmine-menu jasmine-bar jasmine-failure-list', [
specListLink, specListLink,
createDom('span', {}, ' | Failures ') createDom('span', {}, ' | Failures ')
]); ]);
} }
addGlobalFailure(failure) { addGlobalFailure(failure) {
this.add(errorBarClassName, this.#globalFailureMessage(failure)); this.#add(errorBarClassName, this.#globalFailureMessage(failure));
} }
addSeedBar(doneResult, stateBuilder, order) { addSeedBar(doneResult, stateBuilder, order) {
@@ -516,7 +516,7 @@ jasmineRequire.AlertsView = function(j$) {
); );
} }
this.add(statusBarClassName, [statusBarMessage, seedBar]); this.#add(statusBarClassName, [statusBarMessage, seedBar]);
} }
#globalFailureMessage(failure) { #globalFailureMessage(failure) {
@@ -562,11 +562,10 @@ jasmineRequire.AlertsView = function(j$) {
children.push(this.#createExpander(dw.stack)); children.push(this.#createExpander(dw.stack));
} }
this.add('jasmine-bar jasmine-warning', children); this.#add('jasmine-bar jasmine-warning', children);
} }
// TODO private? #add(className, children) {
add(className, children) {
this.rootEl.appendChild(createDom('span', { className }, children)); this.rootEl.appendChild(createDom('span', { className }, children));
} }

View File

@@ -14,11 +14,11 @@ jasmineRequire.AlertsView = function(j$) {
} }
addDuration(ms) { addDuration(ms) {
this.add('jasmine-duration', 'finished in ' + ms / 1000 + 's'); this.#add('jasmine-duration', 'finished in ' + ms / 1000 + 's');
} }
addSkipped(numExecuted, numDefined) { addSkipped(numExecuted, numDefined) {
this.add( this.#add(
'jasmine-bar jasmine-skipped', 'jasmine-bar jasmine-skipped',
createDom( createDom(
'a', 'a',
@@ -50,18 +50,18 @@ jasmineRequire.AlertsView = function(j$) {
return false; return false;
}; };
this.add('jasmine-menu jasmine-bar jasmine-spec-list', [ this.#add('jasmine-menu jasmine-bar jasmine-spec-list', [
createDom('span', {}, 'Spec List | '), createDom('span', {}, 'Spec List | '),
failuresLink failuresLink
]); ]);
this.add('jasmine-menu jasmine-bar jasmine-failure-list', [ this.#add('jasmine-menu jasmine-bar jasmine-failure-list', [
specListLink, specListLink,
createDom('span', {}, ' | Failures ') createDom('span', {}, ' | Failures ')
]); ]);
} }
addGlobalFailure(failure) { addGlobalFailure(failure) {
this.add(errorBarClassName, this.#globalFailureMessage(failure)); this.#add(errorBarClassName, this.#globalFailureMessage(failure));
} }
addSeedBar(doneResult, stateBuilder, order) { addSeedBar(doneResult, stateBuilder, order) {
@@ -112,7 +112,7 @@ jasmineRequire.AlertsView = function(j$) {
); );
} }
this.add(statusBarClassName, [statusBarMessage, seedBar]); this.#add(statusBarClassName, [statusBarMessage, seedBar]);
} }
#globalFailureMessage(failure) { #globalFailureMessage(failure) {
@@ -158,11 +158,10 @@ jasmineRequire.AlertsView = function(j$) {
children.push(this.#createExpander(dw.stack)); children.push(this.#createExpander(dw.stack));
} }
this.add('jasmine-bar jasmine-warning', children); this.#add('jasmine-bar jasmine-warning', children);
} }
// TODO private? #add(className, children) {
add(className, children) {
this.rootEl.appendChild(createDom('span', { className }, children)); this.rootEl.appendChild(createDom('span', { className }, children));
} }