Backfill missing HTML reporter tests
This commit is contained in:
@@ -422,7 +422,6 @@ jasmineRequire.AlertsView = function(j$) {
|
||||
}
|
||||
|
||||
addSkipped(numExecuted, numDefined) {
|
||||
// TODO: backfill tests for this
|
||||
this.add(
|
||||
'jasmine-bar jasmine-skipped',
|
||||
createDom(
|
||||
@@ -469,7 +468,6 @@ jasmineRequire.AlertsView = function(j$) {
|
||||
this.add(errorBarClassName, this.#globalFailureMessage(failure));
|
||||
}
|
||||
|
||||
// TODO check test coverage
|
||||
addSeedBar(doneResult, stateBuilder, order) {
|
||||
let statusBarMessage = '';
|
||||
let statusBarClassName = 'jasmine-overall-result jasmine-bar ';
|
||||
@@ -521,7 +519,6 @@ jasmineRequire.AlertsView = function(j$) {
|
||||
this.add(statusBarClassName, [statusBarMessage, seedBar]);
|
||||
}
|
||||
|
||||
// TODO check test coverage
|
||||
#globalFailureMessage(failure) {
|
||||
if (failure.globalErrorType === 'load') {
|
||||
const prefix = 'Error during loading: ' + failure.message;
|
||||
@@ -746,7 +743,6 @@ jasmineRequire.Banner = function(j$) {
|
||||
'#jasmine-hide-disabled'
|
||||
);
|
||||
hideDisabled.checked = config.hideDisabled;
|
||||
// TODO: backfill tests for this!
|
||||
hideDisabled.onclick = () => {
|
||||
this.#navigateWithNewParam('hideDisabled', !config.hideDisabled);
|
||||
};
|
||||
|
||||
@@ -883,16 +883,19 @@ describe('HtmlReporter', function() {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('UI for hiding disabled specs', function() {
|
||||
it('should be unchecked if not hiding disabled specs', function() {
|
||||
const container = document.createElement('div'),
|
||||
getContainer = function() {
|
||||
return container;
|
||||
},
|
||||
reporter = new jasmineUnderTest.HtmlReporter({
|
||||
env: env,
|
||||
getContainer: getContainer
|
||||
});
|
||||
const container = document.createElement('div');
|
||||
const getContainer = function() {
|
||||
return container;
|
||||
};
|
||||
const navigateHandler = jasmine.createSpy('navigate');
|
||||
const reporter = new jasmineUnderTest.HtmlReporter({
|
||||
env: env,
|
||||
getContainer: getContainer,
|
||||
navigateWithNewParam: navigateHandler
|
||||
});
|
||||
|
||||
env.configure({ hideDisabled: false });
|
||||
reporter.initialize();
|
||||
@@ -900,17 +903,22 @@ describe('HtmlReporter', function() {
|
||||
|
||||
const disabledUI = container.querySelector('.jasmine-disabled');
|
||||
expect(disabledUI.checked).toBe(false);
|
||||
|
||||
disabledUI.click();
|
||||
expect(navigateHandler).toHaveBeenCalledWith('hideDisabled', true);
|
||||
});
|
||||
|
||||
it('should be checked if hiding disabled', function() {
|
||||
const container = document.createElement('div'),
|
||||
getContainer = function() {
|
||||
return container;
|
||||
},
|
||||
reporter = new jasmineUnderTest.HtmlReporter({
|
||||
env: env,
|
||||
getContainer: getContainer
|
||||
});
|
||||
const container = document.createElement('div');
|
||||
const getContainer = function() {
|
||||
return container;
|
||||
};
|
||||
const navigateHandler = jasmine.createSpy('navigate');
|
||||
const reporter = new jasmineUnderTest.HtmlReporter({
|
||||
env: env,
|
||||
getContainer: getContainer,
|
||||
navigateWithNewParam: navigateHandler
|
||||
});
|
||||
|
||||
env.configure({ hideDisabled: true });
|
||||
reporter.initialize();
|
||||
@@ -918,6 +926,9 @@ describe('HtmlReporter', function() {
|
||||
|
||||
const disabledUI = container.querySelector('.jasmine-disabled');
|
||||
expect(disabledUI.checked).toBe(true);
|
||||
|
||||
disabledUI.click();
|
||||
expect(navigateHandler).toHaveBeenCalledWith('hideDisabled', false);
|
||||
});
|
||||
|
||||
it('should not display specs that have been disabled', function() {
|
||||
@@ -946,6 +957,7 @@ describe('HtmlReporter', function() {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('UI for running tests in random order', function() {
|
||||
it('should be unchecked if not randomizing', function() {
|
||||
const container = document.createElement('div'),
|
||||
@@ -1068,6 +1080,34 @@ describe('HtmlReporter', function() {
|
||||
expect(seedBar).toBeNull();
|
||||
});
|
||||
|
||||
it('includes the number of specs in the text of the jasmine-skipped link', function() {
|
||||
const container = document.createElement('div');
|
||||
const reporter = new jasmineUnderTest.HtmlReporter({
|
||||
env: env,
|
||||
getContainer: function() {
|
||||
return container;
|
||||
},
|
||||
addToExistingQueryString: function(key, value) {
|
||||
return '?foo=bar&' + key + '=' + value;
|
||||
}
|
||||
});
|
||||
|
||||
reporter.initialize();
|
||||
const minimalSpecDone = {
|
||||
failedExpectations: [],
|
||||
passedExpectations: []
|
||||
};
|
||||
|
||||
reporter.jasmineStarted({ totalSpecsDefined: 3 });
|
||||
reporter.specDone({ ...minimalSpecDone });
|
||||
reporter.specDone({ ...minimalSpecDone });
|
||||
reporter.specDone({ ...minimalSpecDone, status: 'excluded' });
|
||||
reporter.jasmineDone({});
|
||||
|
||||
const skippedLink = container.querySelector('.jasmine-skipped a');
|
||||
expect(skippedLink.textContent).toEqual('Ran 2 of 3 specs - run all');
|
||||
});
|
||||
|
||||
it('should include non-spec query params in the jasmine-skipped link when present', function() {
|
||||
const container = document.createElement('div'),
|
||||
reporter = new jasmineUnderTest.HtmlReporter({
|
||||
|
||||
@@ -695,6 +695,25 @@ describe('HtmlReporterV2', function() {
|
||||
expect(seedBar).toBeNull();
|
||||
});
|
||||
|
||||
it('includes the number of specs in the text of the jasmine-skipped link', function() {
|
||||
const reporter = setup();
|
||||
|
||||
reporter.initialize();
|
||||
const minimalSpecDone = {
|
||||
failedExpectations: [],
|
||||
passedExpectations: []
|
||||
};
|
||||
|
||||
reporter.jasmineStarted({ totalSpecsDefined: 3 });
|
||||
reporter.specDone({ ...minimalSpecDone });
|
||||
reporter.specDone({ ...minimalSpecDone });
|
||||
reporter.specDone({ ...minimalSpecDone, status: 'excluded' });
|
||||
reporter.jasmineDone({});
|
||||
|
||||
const skippedLink = container.querySelector('.jasmine-skipped a');
|
||||
expect(skippedLink.textContent).toEqual('Ran 2 of 3 specs - run all');
|
||||
});
|
||||
|
||||
it('should include non-spec query params in the jasmine-skipped link when present', function() {
|
||||
const reporter = setup({
|
||||
addToExistingQueryString: function(key, value) {
|
||||
|
||||
@@ -18,7 +18,6 @@ jasmineRequire.AlertsView = function(j$) {
|
||||
}
|
||||
|
||||
addSkipped(numExecuted, numDefined) {
|
||||
// TODO: backfill tests for this
|
||||
this.add(
|
||||
'jasmine-bar jasmine-skipped',
|
||||
createDom(
|
||||
@@ -65,7 +64,6 @@ jasmineRequire.AlertsView = function(j$) {
|
||||
this.add(errorBarClassName, this.#globalFailureMessage(failure));
|
||||
}
|
||||
|
||||
// TODO check test coverage
|
||||
addSeedBar(doneResult, stateBuilder, order) {
|
||||
let statusBarMessage = '';
|
||||
let statusBarClassName = 'jasmine-overall-result jasmine-bar ';
|
||||
@@ -117,7 +115,6 @@ jasmineRequire.AlertsView = function(j$) {
|
||||
this.add(statusBarClassName, [statusBarMessage, seedBar]);
|
||||
}
|
||||
|
||||
// TODO check test coverage
|
||||
#globalFailureMessage(failure) {
|
||||
if (failure.globalErrorType === 'load') {
|
||||
const prefix = 'Error during loading: ' + failure.message;
|
||||
|
||||
@@ -133,7 +133,6 @@ jasmineRequire.Banner = function(j$) {
|
||||
'#jasmine-hide-disabled'
|
||||
);
|
||||
hideDisabled.checked = config.hideDisabled;
|
||||
// TODO: backfill tests for this!
|
||||
hideDisabled.onclick = () => {
|
||||
this.#navigateWithNewParam('hideDisabled', !config.hideDisabled);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user