Skip to content
Snippets Groups Projects
Unverified Commit 4d6d58a1 authored by Mike Greiling's avatar Mike Greiling
Browse files

Resolve eslint violations

parent e277d50b
No related branches found
No related tags found
No related merge requests found
Showing
with 69 additions and 40 deletions
Loading
@@ -13,8 +13,8 @@ describe('Linked Tabs', () => {
Loading
@@ -13,8 +13,8 @@ describe('Linked Tabs', () => {
}); });
   
it('should activate the tab correspondent to the given action', () => { it('should activate the tab correspondent to the given action', () => {
const linkedTabs = new LinkedTabs({ // eslint-disable-next-line no-new
// eslint-disable-line new LinkedTabs({
action: 'tab1', action: 'tab1',
defaultAction: 'tab1', defaultAction: 'tab1',
parentEl: '.linked-tabs', parentEl: '.linked-tabs',
Loading
@@ -24,8 +24,8 @@ describe('Linked Tabs', () => {
Loading
@@ -24,8 +24,8 @@ describe('Linked Tabs', () => {
}); });
   
it('should active the default tab action when the action is show', () => { it('should active the default tab action when the action is show', () => {
const linkedTabs = new LinkedTabs({ // eslint-disable-next-line no-new
// eslint-disable-line new LinkedTabs({
action: 'show', action: 'show',
defaultAction: 'tab1', defaultAction: 'tab1',
parentEl: '.linked-tabs', parentEl: '.linked-tabs',
Loading
Loading
Loading
@@ -23,6 +23,7 @@ describe('NativeFormVariableList', () => {
Loading
@@ -23,6 +23,7 @@ describe('NativeFormVariableList', () => {
expect($row.find('.js-ci-variable-input-key').attr('name')).toBe( expect($row.find('.js-ci-variable-input-key').attr('name')).toBe(
'schedule[variables_attributes][][key]', 'schedule[variables_attributes][][key]',
); );
expect($row.find('.js-ci-variable-input-value').attr('name')).toBe( expect($row.find('.js-ci-variable-input-value').attr('name')).toBe(
'schedule[variables_attributes][][secret_value]', 'schedule[variables_attributes][][secret_value]',
); );
Loading
Loading
Loading
@@ -239,6 +239,7 @@ describe('Application Row', () => {
Loading
@@ -239,6 +239,7 @@ describe('Application Row', () => {
expect(generalErrorMessage.textContent.trim()).toEqual( expect(generalErrorMessage.textContent.trim()).toEqual(
`Something went wrong while installing ${DEFAULT_APPLICATION_STATE.title}`, `Something went wrong while installing ${DEFAULT_APPLICATION_STATE.title}`,
); );
expect(statusErrorMessage.textContent.trim()).toEqual(statusReason); expect(statusErrorMessage.textContent.trim()).toEqual(statusReason);
}); });
   
Loading
@@ -260,6 +261,7 @@ describe('Application Row', () => {
Loading
@@ -260,6 +261,7 @@ describe('Application Row', () => {
expect(generalErrorMessage.textContent.trim()).toEqual( expect(generalErrorMessage.textContent.trim()).toEqual(
`Something went wrong while installing ${DEFAULT_APPLICATION_STATE.title}`, `Something went wrong while installing ${DEFAULT_APPLICATION_STATE.title}`,
); );
expect(requestErrorMessage.textContent.trim()).toEqual(requestReason); expect(requestErrorMessage.textContent.trim()).toEqual(requestReason);
}); });
}); });
Loading
Loading
Loading
@@ -43,6 +43,7 @@ describe('Actions Component', () => {
Loading
@@ -43,6 +43,7 @@ describe('Actions Component', () => {
expect( expect(
component.$el.querySelector('.dropdown-new').getAttribute('data-original-title'), component.$el.querySelector('.dropdown-new').getAttribute('data-original-title'),
).toEqual('Deploy to...'); ).toEqual('Deploy to...');
expect(component.$el.querySelector('.dropdown-new').getAttribute('aria-label')).toEqual( expect(component.$el.querySelector('.dropdown-new').getAttribute('aria-label')).toEqual(
'Deploy to...', 'Deploy to...',
); );
Loading
Loading
Loading
@@ -138,6 +138,7 @@ describe('Filtered Search Visual Tokens', () => {
Loading
@@ -138,6 +138,7 @@ describe('Filtered Search Visual Tokens', () => {
expect(subject.getEndpointWithQueryParams(endpoint, singleQueryParams)).toBe( expect(subject.getEndpointWithQueryParams(endpoint, singleQueryParams)).toBe(
`${endpoint}?foo=true`, `${endpoint}?foo=true`,
); );
expect(subject.getEndpointWithQueryParams(endpoint, multipleQueryParams)).toBe( expect(subject.getEndpointWithQueryParams(endpoint, multipleQueryParams)).toBe(
`${endpoint}?foo=true&bar=true`, `${endpoint}?foo=true&bar=true`,
); );
Loading
Loading
Loading
@@ -90,9 +90,11 @@ describe('ReplacedImageDiff', () => {
Loading
@@ -90,9 +90,11 @@ describe('ReplacedImageDiff', () => {
expect(imageFrameEls[viewTypes.TWO_UP]).toEqual( expect(imageFrameEls[viewTypes.TWO_UP]).toEqual(
element.querySelector('.two-up .js-image-frame'), element.querySelector('.two-up .js-image-frame'),
); );
expect(imageFrameEls[viewTypes.SWIPE]).toEqual( expect(imageFrameEls[viewTypes.SWIPE]).toEqual(
element.querySelector('.swipe .js-image-frame'), element.querySelector('.swipe .js-image-frame'),
); );
expect(imageFrameEls[viewTypes.ONION_SKIN]).toEqual( expect(imageFrameEls[viewTypes.ONION_SKIN]).toEqual(
element.querySelector('.onion-skin .js-image-frame'), element.querySelector('.onion-skin .js-image-frame'),
); );
Loading
@@ -105,9 +107,11 @@ describe('ReplacedImageDiff', () => {
Loading
@@ -105,9 +107,11 @@ describe('ReplacedImageDiff', () => {
expect(viewModesEls[viewTypes.TWO_UP]).toEqual( expect(viewModesEls[viewTypes.TWO_UP]).toEqual(
element.querySelector('.view-modes-menu .two-up'), element.querySelector('.view-modes-menu .two-up'),
); );
expect(viewModesEls[viewTypes.SWIPE]).toEqual( expect(viewModesEls[viewTypes.SWIPE]).toEqual(
element.querySelector('.view-modes-menu .swipe'), element.querySelector('.view-modes-menu .swipe'),
); );
expect(viewModesEls[viewTypes.ONION_SKIN]).toEqual( expect(viewModesEls[viewTypes.ONION_SKIN]).toEqual(
element.querySelector('.view-modes-menu .onion-skin'), element.querySelector('.view-modes-menu .onion-skin'),
); );
Loading
Loading
Loading
@@ -164,6 +164,7 @@ describe('IntegrationSettingsForm', () => {
Loading
@@ -164,6 +164,7 @@ describe('IntegrationSettingsForm', () => {
.text() .text()
.trim(), .trim(),
).toEqual('Test failed. some error'); ).toEqual('Test failed. some error');
expect($flashContainer.find('.flash-action')).toBeDefined(); expect($flashContainer.find('.flash-action')).toBeDefined();
expect( expect(
$flashContainer $flashContainer
Loading
@@ -197,6 +198,7 @@ describe('IntegrationSettingsForm', () => {
Loading
@@ -197,6 +198,7 @@ describe('IntegrationSettingsForm', () => {
.text() .text()
.trim(), .trim(),
).toEqual('Validations failed. some error'); ).toEqual('Validations failed. some error');
expect($flashContainer.find('.flash-action')).toBeDefined(); expect($flashContainer.find('.flash-action')).toBeDefined();
expect( expect(
$flashContainer $flashContainer
Loading
Loading
Loading
@@ -74,6 +74,7 @@ describe('Issuable output', () => {
Loading
@@ -74,6 +74,7 @@ describe('Issuable output', () => {
expect(vm.$el.querySelector('.js-task-list-field').value).toContain( expect(vm.$el.querySelector('.js-task-list-field').value).toContain(
'this is a description', 'this is a description',
); );
expect(formatText(editedText.innerText)).toMatch(/Edited[\s\S]+?by Some User/); expect(formatText(editedText.innerText)).toMatch(/Edited[\s\S]+?by Some User/);
expect(editedText.querySelector('.author-link').href).toMatch(/\/some_user$/); expect(editedText.querySelector('.author-link').href).toMatch(/\/some_user$/);
expect(editedText.querySelector('time')).toBeTruthy(); expect(editedText.querySelector('time')).toBeTruthy();
Loading
@@ -91,6 +92,7 @@ describe('Issuable output', () => {
Loading
@@ -91,6 +92,7 @@ describe('Issuable output', () => {
expect(formatText(vm.$el.querySelector('.edited-text').innerText)).toMatch( expect(formatText(vm.$el.querySelector('.edited-text').innerText)).toMatch(
/Edited[\s\S]+?by Other User/, /Edited[\s\S]+?by Other User/,
); );
expect(editedText.querySelector('.author-link').href).toMatch(/\/other_user$/); expect(editedText.querySelector('.author-link').href).toMatch(/\/other_user$/);
expect(editedText.querySelector('time')).toBeTruthy(); expect(editedText.querySelector('time')).toBeTruthy();
}) })
Loading
@@ -294,8 +296,9 @@ describe('Issuable output', () => {
Loading
@@ -294,8 +296,9 @@ describe('Issuable output', () => {
it('opens recaptcha modal if update rejected as spam', done => { it('opens recaptcha modal if update rejected as spam', done => {
function mockScriptSrc() { function mockScriptSrc() {
const recaptchaChild = vm.$children.find( const recaptchaChild = vm.$children.find(
// eslint-disable-next-line no-underscore-dangle
child => child.$options._componentTag === 'recaptcha-modal', child => child.$options._componentTag === 'recaptcha-modal',
); // eslint-disable-line no-underscore-dangle );
   
recaptchaChild.scriptSrc = '//scriptsrc'; recaptchaChild.scriptSrc = '//scriptsrc';
} }
Loading
Loading
Loading
@@ -54,8 +54,9 @@ describe('Description component', () => {
Loading
@@ -54,8 +54,9 @@ describe('Description component', () => {
it('opens recaptcha dialog if update rejected as spam', done => { it('opens recaptcha dialog if update rejected as spam', done => {
let modal; let modal;
const recaptchaChild = vm.$children.find( const recaptchaChild = vm.$children.find(
// eslint-disable-next-line no-underscore-dangle
child => child.$options._componentTag === 'recaptcha-modal', child => child.$options._componentTag === 'recaptcha-modal',
); // eslint-disable-line no-underscore-dangle );
   
recaptchaChild.scriptSrc = '//scriptsrc'; recaptchaChild.scriptSrc = '//scriptsrc';
   
Loading
Loading
Loading
@@ -51,10 +51,12 @@ describe('Trigger block', () => {
Loading
@@ -51,10 +51,12 @@ describe('Trigger block', () => {
expect(vm.$el.querySelector('.js-build-variables').textContent).toContain( expect(vm.$el.querySelector('.js-build-variables').textContent).toContain(
'UPLOAD_TO_GCS', 'UPLOAD_TO_GCS',
); );
expect(vm.$el.querySelector('.js-build-variables').textContent).toContain('false'); expect(vm.$el.querySelector('.js-build-variables').textContent).toContain('false');
expect(vm.$el.querySelector('.js-build-variables').textContent).toContain( expect(vm.$el.querySelector('.js-build-variables').textContent).toContain(
'UPLOAD_TO_S3', 'UPLOAD_TO_S3',
); );
expect(vm.$el.querySelector('.js-build-variables').textContent).toContain('true'); expect(vm.$el.querySelector('.js-build-variables').textContent).toContain('true');
}) })
.then(done) .then(done)
Loading
Loading
Loading
@@ -59,9 +59,11 @@ describe('EmptyState', () => {
Loading
@@ -59,9 +59,11 @@ describe('EmptyState', () => {
expect(getTextFromNode(component, '.state-title')).toEqual( expect(getTextFromNode(component, '.state-title')).toEqual(
component.states.gettingStarted.title, component.states.gettingStarted.title,
); );
expect(getTextFromNode(component, '.state-description')).toEqual( expect(getTextFromNode(component, '.state-description')).toEqual(
component.states.gettingStarted.description, component.states.gettingStarted.description,
); );
expect(getTextFromNode(component, '.btn-success')).toEqual( expect(getTextFromNode(component, '.btn-success')).toEqual(
component.states.gettingStarted.buttonText, component.states.gettingStarted.buttonText,
); );
Loading
@@ -77,6 +79,7 @@ describe('EmptyState', () => {
Loading
@@ -77,6 +79,7 @@ describe('EmptyState', () => {
expect(getTextFromNode(component, '.state-description')).toEqual( expect(getTextFromNode(component, '.state-description')).toEqual(
component.states.loading.description, component.states.loading.description,
); );
expect(getTextFromNode(component, '.btn-success')).toEqual(component.states.loading.buttonText); expect(getTextFromNode(component, '.btn-success')).toEqual(component.states.loading.buttonText);
}); });
   
Loading
@@ -89,6 +92,7 @@ describe('EmptyState', () => {
Loading
@@ -89,6 +92,7 @@ describe('EmptyState', () => {
expect(getTextFromNode(component, '.state-title')).toEqual( expect(getTextFromNode(component, '.state-title')).toEqual(
component.states.unableToConnect.title, component.states.unableToConnect.title,
); );
expect(component.$el.querySelector('.state-description a')).toBeDefined(); expect(component.$el.querySelector('.state-description a')).toBeDefined();
expect(getTextFromNode(component, '.btn-success')).toEqual( expect(getTextFromNode(component, '.btn-success')).toEqual(
component.states.unableToConnect.buttonText, component.states.unableToConnect.buttonText,
Loading
Loading
/* eslint-disable one-var, no-var, no-return-assign */
import $ from 'jquery'; import $ from 'jquery';
import NewBranchForm from '~/new_branch_form'; import NewBranchForm from '~/new_branch_form';
   
describe('Branch', function() { describe('Branch', function() {
describe('create a new branch', function() { describe('create a new branch', function() {
var expectToHaveError, fillNameWith;
preloadFixtures('branches/new_branch.html.raw'); preloadFixtures('branches/new_branch.html.raw');
fillNameWith = function(value) {
return $('.js-branch-name') function fillNameWith(value) {
$('.js-branch-name')
.val(value) .val(value)
.trigger('blur'); .trigger('blur');
}; }
expectToHaveError = function(error) {
function expectToHaveError(error) {
expect($('.js-branch-name-error span').text()).toEqual(error); expect($('.js-branch-name-error span').text()).toEqual(error);
}; }
beforeEach(function() { beforeEach(function() {
loadFixtures('branches/new_branch.html.raw'); loadFixtures('branches/new_branch.html.raw');
$('form').on('submit', function(e) { $('form').on('submit', function(e) {
return e.preventDefault(); return e.preventDefault();
}); });
return (this.form = new NewBranchForm($('.js-create-branch-form'), [])); this.form = new NewBranchForm($('.js-create-branch-form'), []);
}); });
   
it("can't start with a dot", function() { it("can't start with a dot", function() {
fillNameWith('.foo'); fillNameWith('.foo');
return expectToHaveError("can't start with '.'"); expectToHaveError("can't start with '.'");
}); });
   
it("can't start with a slash", function() { it("can't start with a slash", function() {
fillNameWith('/foo'); fillNameWith('/foo');
return expectToHaveError("can't start with '/'"); expectToHaveError("can't start with '/'");
}); });
   
it("can't have two consecutive dots", function() { it("can't have two consecutive dots", function() {
fillNameWith('foo..bar'); fillNameWith('foo..bar');
return expectToHaveError("can't contain '..'"); expectToHaveError("can't contain '..'");
}); });
   
it("can't have spaces anywhere", function() { it("can't have spaces anywhere", function() {
Loading
@@ -44,7 +44,7 @@ describe('Branch', function() {
Loading
@@ -44,7 +44,7 @@ describe('Branch', function() {
fillNameWith('foo bar'); fillNameWith('foo bar');
expectToHaveError("can't contain spaces"); expectToHaveError("can't contain spaces");
fillNameWith('foo '); fillNameWith('foo ');
return expectToHaveError("can't contain spaces"); expectToHaveError("can't contain spaces");
}); });
   
it("can't have ~ anywhere", function() { it("can't have ~ anywhere", function() {
Loading
@@ -53,7 +53,7 @@ describe('Branch', function() {
Loading
@@ -53,7 +53,7 @@ describe('Branch', function() {
fillNameWith('foo~bar'); fillNameWith('foo~bar');
expectToHaveError("can't contain '~'"); expectToHaveError("can't contain '~'");
fillNameWith('foo~'); fillNameWith('foo~');
return expectToHaveError("can't contain '~'"); expectToHaveError("can't contain '~'");
}); });
   
it("can't have tilde anwhere", function() { it("can't have tilde anwhere", function() {
Loading
@@ -62,7 +62,7 @@ describe('Branch', function() {
Loading
@@ -62,7 +62,7 @@ describe('Branch', function() {
fillNameWith('foo~bar'); fillNameWith('foo~bar');
expectToHaveError("can't contain '~'"); expectToHaveError("can't contain '~'");
fillNameWith('foo~'); fillNameWith('foo~');
return expectToHaveError("can't contain '~'"); expectToHaveError("can't contain '~'");
}); });
   
it("can't have caret anywhere", function() { it("can't have caret anywhere", function() {
Loading
@@ -71,7 +71,7 @@ describe('Branch', function() {
Loading
@@ -71,7 +71,7 @@ describe('Branch', function() {
fillNameWith('foo^bar'); fillNameWith('foo^bar');
expectToHaveError("can't contain '^'"); expectToHaveError("can't contain '^'");
fillNameWith('foo^'); fillNameWith('foo^');
return expectToHaveError("can't contain '^'"); expectToHaveError("can't contain '^'");
}); });
   
it("can't have : anywhere", function() { it("can't have : anywhere", function() {
Loading
@@ -80,7 +80,7 @@ describe('Branch', function() {
Loading
@@ -80,7 +80,7 @@ describe('Branch', function() {
fillNameWith('foo:bar'); fillNameWith('foo:bar');
expectToHaveError("can't contain ':'"); expectToHaveError("can't contain ':'");
fillNameWith(':foo'); fillNameWith(':foo');
return expectToHaveError("can't contain ':'"); expectToHaveError("can't contain ':'");
}); });
   
it("can't have question mark anywhere", function() { it("can't have question mark anywhere", function() {
Loading
@@ -89,7 +89,7 @@ describe('Branch', function() {
Loading
@@ -89,7 +89,7 @@ describe('Branch', function() {
fillNameWith('foo?bar'); fillNameWith('foo?bar');
expectToHaveError("can't contain '?'"); expectToHaveError("can't contain '?'");
fillNameWith('foo?'); fillNameWith('foo?');
return expectToHaveError("can't contain '?'"); expectToHaveError("can't contain '?'");
}); });
   
it("can't have asterisk anywhere", function() { it("can't have asterisk anywhere", function() {
Loading
@@ -98,7 +98,7 @@ describe('Branch', function() {
Loading
@@ -98,7 +98,7 @@ describe('Branch', function() {
fillNameWith('foo*bar'); fillNameWith('foo*bar');
expectToHaveError("can't contain '*'"); expectToHaveError("can't contain '*'");
fillNameWith('foo*'); fillNameWith('foo*');
return expectToHaveError("can't contain '*'"); expectToHaveError("can't contain '*'");
}); });
   
it("can't have open bracket anywhere", function() { it("can't have open bracket anywhere", function() {
Loading
@@ -107,7 +107,7 @@ describe('Branch', function() {
Loading
@@ -107,7 +107,7 @@ describe('Branch', function() {
fillNameWith('foo[bar'); fillNameWith('foo[bar');
expectToHaveError("can't contain '['"); expectToHaveError("can't contain '['");
fillNameWith('foo['); fillNameWith('foo[');
return expectToHaveError("can't contain '['"); expectToHaveError("can't contain '['");
}); });
   
it("can't have a backslash anywhere", function() { it("can't have a backslash anywhere", function() {
Loading
@@ -116,7 +116,7 @@ describe('Branch', function() {
Loading
@@ -116,7 +116,7 @@ describe('Branch', function() {
fillNameWith('foo\\bar'); fillNameWith('foo\\bar');
expectToHaveError("can't contain '\\'"); expectToHaveError("can't contain '\\'");
fillNameWith('foo\\'); fillNameWith('foo\\');
return expectToHaveError("can't contain '\\'"); expectToHaveError("can't contain '\\'");
}); });
   
it("can't contain a sequence @{ anywhere", function() { it("can't contain a sequence @{ anywhere", function() {
Loading
@@ -125,44 +125,42 @@ describe('Branch', function() {
Loading
@@ -125,44 +125,42 @@ describe('Branch', function() {
fillNameWith('foo@{bar'); fillNameWith('foo@{bar');
expectToHaveError("can't contain '@{'"); expectToHaveError("can't contain '@{'");
fillNameWith('foo@{'); fillNameWith('foo@{');
return expectToHaveError("can't contain '@{'"); expectToHaveError("can't contain '@{'");
}); });
   
it("can't have consecutive slashes", function() { it("can't have consecutive slashes", function() {
fillNameWith('foo//bar'); fillNameWith('foo//bar');
return expectToHaveError("can't contain consecutive slashes"); expectToHaveError("can't contain consecutive slashes");
}); });
   
it("can't end with a slash", function() { it("can't end with a slash", function() {
fillNameWith('foo/'); fillNameWith('foo/');
return expectToHaveError("can't end in '/'"); expectToHaveError("can't end in '/'");
}); });
   
it("can't end with a dot", function() { it("can't end with a dot", function() {
fillNameWith('foo.'); fillNameWith('foo.');
return expectToHaveError("can't end in '.'"); expectToHaveError("can't end in '.'");
}); });
   
it("can't end with .lock", function() { it("can't end with .lock", function() {
fillNameWith('foo.lock'); fillNameWith('foo.lock');
return expectToHaveError("can't end in '.lock'"); expectToHaveError("can't end in '.lock'");
}); });
   
it("can't be the single character @", function() { it("can't be the single character @", function() {
fillNameWith('@'); fillNameWith('@');
return expectToHaveError("can't be '@'"); expectToHaveError("can't be '@'");
}); });
   
it('concatenates all error messages', function() { it('concatenates all error messages', function() {
fillNameWith('/foo bar?~.'); fillNameWith('/foo bar?~.');
return expectToHaveError( expectToHaveError("can't start with '/', can't contain spaces, '?', '~', can't end in '.'");
"can't start with '/', can't contain spaces, '?', '~', can't end in '.'",
);
}); });
   
it("doesn't duplicate error messages", function() { it("doesn't duplicate error messages", function() {
fillNameWith('?foo?bar?zoo?'); fillNameWith('?foo?bar?zoo?');
return expectToHaveError("can't contain '?'"); expectToHaveError("can't contain '?'");
}); });
   
it('removes the error message when is a valid name', function() { it('removes the error message when is a valid name', function() {
Loading
Loading
Loading
@@ -50,7 +50,7 @@ export default {
Loading
@@ -50,7 +50,7 @@ export default {
output: '<a>foo</a>', output: '<a>foo</a>',
}, },
'protocol-based JS injection: invalid URL char': { 'protocol-based JS injection: invalid URL char': {
input: '<img src=javascript:alert("XSS")>', // eslint-disable-line no-useless-escape input: '<img src=javascript:alert("XSS")>',
output: '<img>', output: '<img>',
}, },
'protocol-based JS injection: Unicode': { 'protocol-based JS injection: Unicode': {
Loading
Loading
Loading
@@ -16,6 +16,7 @@ describe('OAuthRememberMe', () => {
Loading
@@ -16,6 +16,7 @@ describe('OAuthRememberMe', () => {
expect($('#oauth-container .oauth-login.twitter').attr('href')).toBe( expect($('#oauth-container .oauth-login.twitter').attr('href')).toBe(
'http://example.com/?remember_me=1', 'http://example.com/?remember_me=1',
); );
expect($('#oauth-container .oauth-login.github').attr('href')).toBe( expect($('#oauth-container .oauth-login.github').attr('href')).toBe(
'http://example.com/?remember_me=1', 'http://example.com/?remember_me=1',
); );
Loading
Loading
Loading
@@ -50,6 +50,7 @@ describe('Pipelines Empty State', () => {
Loading
@@ -50,6 +50,7 @@ describe('Pipelines Empty State', () => {
expect(component.$el.querySelector('.js-get-started-pipelines').getAttribute('href')).toEqual( expect(component.$el.querySelector('.js-get-started-pipelines').getAttribute('href')).toEqual(
'foo', 'foo',
); );
expect(component.$el.querySelector('.js-get-started-pipelines').textContent).toContain( expect(component.$el.querySelector('.js-get-started-pipelines').textContent).toContain(
'Get started with Pipelines', 'Get started with Pipelines',
); );
Loading
Loading
Loading
@@ -171,6 +171,7 @@ describe('Pipelines', () => {
Loading
@@ -171,6 +171,7 @@ describe('Pipelines', () => {
expect(vm.$el.querySelector('.js-empty-state h4').textContent.trim()).toEqual( expect(vm.$el.querySelector('.js-empty-state h4').textContent.trim()).toEqual(
'Build with confidence', 'Build with confidence',
); );
expect(vm.$el.querySelector('.js-get-started-pipelines').getAttribute('href')).toEqual( expect(vm.$el.querySelector('.js-get-started-pipelines').getAttribute('href')).toEqual(
paths.helpPagePath, paths.helpPagePath,
); );
Loading
@@ -207,6 +208,7 @@ describe('Pipelines', () => {
Loading
@@ -207,6 +208,7 @@ describe('Pipelines', () => {
expect(vm.$el.querySelector('.js-run-pipeline').getAttribute('href')).toEqual( expect(vm.$el.querySelector('.js-run-pipeline').getAttribute('href')).toEqual(
paths.newPipelinePath, paths.newPipelinePath,
); );
expect(vm.$el.querySelector('.js-ci-lint').getAttribute('href')).toEqual(paths.ciLintPath); expect(vm.$el.querySelector('.js-ci-lint').getAttribute('href')).toEqual(paths.ciLintPath);
expect(vm.$el.querySelector('.js-clear-cache').textContent.trim()).toEqual( expect(vm.$el.querySelector('.js-clear-cache').textContent.trim()).toEqual(
'Clear Runner Caches', 'Clear Runner Caches',
Loading
@@ -324,6 +326,7 @@ describe('Pipelines', () => {
Loading
@@ -324,6 +326,7 @@ describe('Pipelines', () => {
expect(vm.$el.querySelector('.js-empty-state').textContent.trim()).toEqual( expect(vm.$el.querySelector('.js-empty-state').textContent.trim()).toEqual(
'This project is not currently set up to run pipelines.', 'This project is not currently set up to run pipelines.',
); );
expect(vm.$el.querySelector('.js-get-started-pipelines')).toBeNull(); expect(vm.$el.querySelector('.js-get-started-pipelines')).toBeNull();
}); });
   
Loading
Loading
Loading
@@ -41,12 +41,15 @@ describe('Pipelines Table', () => {
Loading
@@ -41,12 +41,15 @@ describe('Pipelines Table', () => {
expect( expect(
component.$el.querySelector('.table-section.js-pipeline-status').textContent.trim(), component.$el.querySelector('.table-section.js-pipeline-status').textContent.trim(),
).toEqual('Status'); ).toEqual('Status');
expect( expect(
component.$el.querySelector('.table-section.js-pipeline-info').textContent.trim(), component.$el.querySelector('.table-section.js-pipeline-info').textContent.trim(),
).toEqual('Pipeline'); ).toEqual('Pipeline');
expect( expect(
component.$el.querySelector('.table-section.js-pipeline-commit').textContent.trim(), component.$el.querySelector('.table-section.js-pipeline-commit').textContent.trim(),
).toEqual('Commit'); ).toEqual('Commit');
expect( expect(
component.$el.querySelector('.table-section.js-pipeline-stages').textContent.trim(), component.$el.querySelector('.table-section.js-pipeline-stages').textContent.trim(),
).toEqual('Stages'); ).toEqual('Stages');
Loading
Loading
Loading
@@ -13,7 +13,7 @@ describe('Pipelines', () => {
Loading
@@ -13,7 +13,7 @@ describe('Pipelines', () => {
   
it('should create a `Pipelines` instance without options', () => { it('should create a `Pipelines` instance without options', () => {
expect(() => { expect(() => {
new Pipelines(); new Pipelines(); // eslint-disable-line no-new
}).not.toThrow(); //eslint-disable-line }).not.toThrow();
}); });
}); });
Loading
@@ -88,6 +88,7 @@ describe('PrometheusMetrics', () => {
Loading
@@ -88,6 +88,7 @@ describe('PrometheusMetrics', () => {
expect(prometheusMetrics.$monitoredMetricsCount.text()).toEqual( expect(prometheusMetrics.$monitoredMetricsCount.text()).toEqual(
'3 exporters with 12 metrics were found', '3 exporters with 12 metrics were found',
); );
expect($metricsListLi.length).toEqual(metrics.length); expect($metricsListLi.length).toEqual(metrics.length);
expect( expect(
$metricsListLi $metricsListLi
Loading
Loading
Loading
@@ -36,6 +36,7 @@ describe('Grouped Test Reports Modal', () => {
Loading
@@ -36,6 +36,7 @@ describe('Grouped Test Reports Modal', () => {
expect(vm.$el.querySelector('.js-modal-link').getAttribute('href')).toEqual( expect(vm.$el.querySelector('.js-modal-link').getAttribute('href')).toEqual(
modalDataStructure.class.value, modalDataStructure.class.value,
); );
expect(trimText(vm.$el.querySelector('.js-modal-link').textContent)).toEqual( expect(trimText(vm.$el.querySelector('.js-modal-link').textContent)).toEqual(
modalDataStructure.class.value, modalDataStructure.class.value,
); );
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment