Merge branch 'hide-grey-specs' of https://github.com/SamFare/jasmine into SamFare-hide-grey-specs

- Merges #1561 from @SamFare
This commit is contained in:
Gregg Van Hove
2018-05-23 17:14:53 -07:00
9 changed files with 162 additions and 7 deletions

View File

@@ -78,6 +78,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
var throwingExpectationFailures = queryString.getParam("throwFailures");
env.throwOnExpectationFailure(throwingExpectationFailures);
var hideDisabled = queryString.getParam("hideDisabled");
env.hideDisabled(hideDisabled);
var random = queryString.getParam("random");

View File

@@ -56,6 +56,9 @@
var throwingExpectationFailures = queryString.getParam("throwFailures");
env.throwOnExpectationFailure(throwingExpectationFailures);
var hideDisabled = queryString.getParam("hideDisabled");
env.hideDisabled(hideDisabled);
var random = queryString.getParam("random");

View File

@@ -148,7 +148,7 @@ jasmineRequire.HtmlReporter = function(j$) {
}
symbols.appendChild(createDom('li', {
className: noExpectations(result) ? 'jasmine-empty' : 'jasmine-' + result.status,
className: this.displaySpecInCorrectFormat(result),
id: 'spec_' + result.id,
title: result.fullName
}
@@ -161,6 +161,17 @@ jasmineRequire.HtmlReporter = function(j$) {
addDeprecationWarnings(result);
};
this.displaySpecInCorrectFormat = function(result) {
return noExpectations(result) ? 'jasmine-empty' : this.resultStatus(result.status);
};
this.resultStatus = function(status) {
if(status === 'excluded') {
return env.hidingDisabled() ? 'jasmine-excluded-no-display' : 'jasmine-excluded';
}
return 'jasmine-' + status;
};
this.jasmineDone = function(doneResult) {
var banner = find('.jasmine-banner');
var alert = find('.jasmine-alert');
@@ -352,7 +363,14 @@ jasmineRequire.HtmlReporter = function(j$) {
id: 'jasmine-random-order',
type: 'checkbox'
}),
createDom('label', { className: 'jasmine-label', 'for': 'jasmine-random-order' }, 'run tests in random order'))
createDom('label', { className: 'jasmine-label', 'for': 'jasmine-random-order' }, 'run tests in random order')),
createDom('div', { className: 'jasmine-hide-disabled' },
createDom('input', {
className: 'jasmine-disabled',
id: 'jasmine-hide-disabled',
type: 'checkbox'
}),
createDom('label', { className: 'jasmine-label', 'for': 'jasmine-hide-disabled' }, 'hide disabled tests'))
)
);
@@ -374,6 +392,12 @@ jasmineRequire.HtmlReporter = function(j$) {
navigateWithNewParam('random', !env.randomTests());
};
var hideDisabled = optionsMenuDom.querySelector('#jasmine-hide-disabled');
hideDisabled.checked = env.hidingDisabled();
hideDisabled.onclick = function() {
navigateWithNewParam('hideDisabled', !env.hidingDisabled());
};
var optionsTrigger = optionsMenuDom.querySelector('.jasmine-trigger'),
optionsPayload = optionsMenuDom.querySelector('.jasmine-payload'),
isOpen = /\bjasmine-open\b/;

View File

@@ -20,6 +20,7 @@ body { overflow-y: scroll; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-failed:before { color: #ca3a11; content: "\d7"; font-weight: bold; margin-left: -1px; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-excluded { font-size: 14px; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-excluded:before { color: #bababa; content: "\02022"; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-excluded-no-display { font-size: 14px; display: none; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-pending { line-height: 17px; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-pending:before { color: #ba9d37; content: "*"; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-empty { font-size: 14px; }

View File

@@ -791,6 +791,7 @@ getJasmineRequireObj().Env = function(j$) {
var throwOnExpectationFailure = false;
var stopOnSpecFailure = false;
var random = true;
var hidingDisabled = false;
var seed = null;
var handlingLoadErrors = true;
var hasFailures = false;
@@ -959,6 +960,14 @@ getJasmineRequireObj().Env = function(j$) {
random = !!value;
};
this.hidingDisabled = function(value) {
return hidingDisabled;
};
this.hideDisabled = function(value) {
hidingDisabled = !!value;
};
this.randomTests = function() {
return random;
};