Skip to content

Commit

Permalink
MM-7443 disable ESlint jQuery checks for e2e tests (mattermost#6210)
Browse files Browse the repository at this point in the history
- Update e2e config overrides
  • Loading branch information
CEOehis committed Aug 21, 2020
1 parent a512558 commit adf907b
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 11 deletions.
51 changes: 50 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,56 @@
"import/no-unresolved": 0,
"max-nested-callbacks": 0,
"no-process-env": 0,
"no-unused-expressions": 0
"no-unused-expressions": 0,
"jquery/no-ajax": 0,
"jquery/no-ajax-events": 0,
"jquery/no-animate": 0,
"jquery/no-attr": 0,
"jquery/no-bind": 0,
"jquery/no-class": 0,
"jquery/no-clone": 0,
"jquery/no-closest": 0,
"jquery/no-css": 0,
"jquery/no-data": 0,
"jquery/no-deferred": 0,
"jquery/no-delegate": 0,
"jquery/no-each": 0,
"jquery/no-extend": 0,
"jquery/no-fade": 0,
"jquery/no-filter": 0,
"jquery/no-find": 0,
"jquery/no-global-eval": 0,
"jquery/no-grep": 0,
"jquery/no-has": 0,
"jquery/no-hide": 0,
"jquery/no-html": 0,
"jquery/no-in-array": 0,
"jquery/no-is-array": 0,
"jquery/no-is-function": 0,
"jquery/no-is": 0,
"jquery/no-load": 0,
"jquery/no-map": 0,
"jquery/no-merge": 0,
"jquery/no-param": 0,
"jquery/no-parent": 0,
"jquery/no-parents": 0,
"jquery/no-parse-html": 0,
"jquery/no-prop": 0,
"jquery/no-proxy": 0,
"jquery/no-ready": 0,
"jquery/no-serialize": 0,
"jquery/no-show": 0,
"jquery/no-size": 0,
"jquery/no-sizzle": 0,
"jquery/no-slide": 0,
"jquery/no-submit": 0,
"jquery/no-text": 0,
"jquery/no-toggle": 0,
"jquery/no-trigger": 0,
"jquery/no-trim": 0,
"jquery/no-val": 0,
"jquery/no-when": 0,
"jquery/no-wrap": 0
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe('Verify Accessibility Support in different sections in Account Settings
if (section.type === 'text') {
cy.get(`#${section.key}Edit`).click();
cy.get('.setting-list-item .form-group').each(($el) => {
if ($el.find('input').length) { // eslint-disable-line jquery/no-find
if ($el.find('input').length) {
cy.wrap($el).find('.control-label').invoke('text').then((label) => {
cy.wrap($el).find('input').should('have.attr', 'aria-label', label);
});
Expand Down
4 changes: 2 additions & 2 deletions e2e/cypress/integration/emoji/recently_used_emoji_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ describe('Recent Emoji', () => {

// * Assert first emoji should equal with second recent emoji
cy.get('.emoji-picker__item').eq(firstEmoji + 2).find('img').then(($el) => {
cy.get('.emoji-picker__item').eq(1).find('img').should('have.attr', 'class', $el.attr('class')); // eslint-disable-line jquery/no-attr
cy.get('.emoji-picker__item').eq(1).find('img').should('have.attr', 'class', $el.attr('class'));
});

// * Assert second emoji should equal with first recent emoji
cy.get('.emoji-picker__item').eq(secondEmoji + 1).find('img').then(($el) => {
cy.get('.emoji-picker__item').eq(0).find('img').should('have.attr', 'class', $el.attr('class')); // eslint-disable-line jquery/no-attr
cy.get('.emoji-picker__item').eq(0).find('img').should('have.attr', 'class', $el.attr('class'));
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ describe('Messaging', () => {
and('have.attr', 'alt', label);

// # Assign the value of the a tag href to the 'href' variable and assert the link is valid
// eslint-disable-next-line jquery/no-prop
const href = $a.prop('href');
cy.request(href).its('body').should('include', '</html>');
});
Expand Down
8 changes: 4 additions & 4 deletions e2e/cypress/integration/messaging/system_message_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
// helper function to count the lines in a block of text by wrapping each word in a span and finding where the text breaks the line
function getLines(e) {
const $cont = Cypress.$(e);
const textArr = $cont.text().split(' '); // eslint-disable-line jquery/no-text
const textArr = $cont.text().split(' ');

for (let i = 0; i < textArr.length; i++) {
textArr[i] = '<span>' + textArr[i] + ' </span>';
}

$cont.html(textArr.join('')); // eslint-disable-line jquery/no-html
$cont.html(textArr.join(''));

const $wordSpans = $cont.find('span'); // eslint-disable-line jquery/no-find
const $wordSpans = $cont.find('span');
const lineArray = [];
var lineIndex = 0;
var lineStart = true;

$wordSpans.each(function handleWord(idx) { // eslint-disable-line jquery/no-each
$wordSpans.each(function handleWord(idx) {
const top = Cypress.$(this).position().top;

if (lineStart) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
/* eslint-disable jquery/no-text */
/* eslint-disable jquery/no-find */

describe('Multi-user group messages', () => {
let testUser;
Expand Down

0 comments on commit adf907b

Please sign in to comment.