Cypress eslint fixes and config (#3636)

This commit is contained in:
Ran Byron
2019-03-25 22:14:51 +02:00
committed by GitHub
parent 0995dfbf43
commit ec4b36b178
7 changed files with 30 additions and 18 deletions

View File

@@ -1,3 +1,3 @@
build/*.js
config/*.js
node_modules
client/dist

View File

@@ -1,7 +1,7 @@
module.exports = {
root: true,
extends: ["airbnb", "plugin:jest/recommended"],
plugins: ["jest", "cypress"],
plugins: ["jest", "cypress", "chai-friendly"],
settings: {
"import/resolver": "webpack"
},
@@ -56,5 +56,9 @@ module.exports = {
}],
"no-else-return": ["error", {"allowElseIf": true}],
"object-curly-newline": ["error", {"consistent": true}],
// needed for cypress tests
"func-names": "off",
"no-unused-expressions": 0,
"chai-friendly/no-unused-expressions": 2
}
};

View File

@@ -19,6 +19,7 @@ const WidgetDialog = {
},
};
const EditTextBoxComponent = {
template: editTextBoxTemplate,
bindings: {

View File

@@ -131,7 +131,7 @@ describe('Dashboard', () => {
});
});
it('archives dashboard', function () {
it('archives dashboard', () => {
createNewDashboardByAPI('Foo Bar').then(({ slug }) => {
cy.visit(`/dashboard/${slug}`);
@@ -201,6 +201,7 @@ describe('Dashboard', () => {
});
});
// eslint-disable-next-line jest/no-disabled-tests
it.skip('allows opening menu after removal', function () {
let elTestId1;
addTextboxByAPI('txb 1', this.dashboardId)

View File

@@ -1,24 +1,24 @@
describe("Search Query", () => {
describe('Search Query', () => {
beforeEach(() => {
cy.login();
cy.request("POST", "api/queries", {
name: "Users Count",
cy.request('POST', 'api/queries', {
name: 'Users Count',
data_source_id: 1,
query: "SELECT 1"
query: 'SELECT 1',
});
cy.request("POST", "api/queries", {
name: "Dashboards Count",
cy.request('POST', 'api/queries', {
name: 'Dashboards Count',
data_source_id: 1,
query: "SELECT 1"
query: 'SELECT 1',
});
cy.visit("/");
cy.visit('/');
});
it("finds queries by name", () => {
cy.getByTestId("AppHeaderSearch").type("Users{enter}");
cy.contains("Users Count");
it('finds queries by name', () => {
cy.getByTestId('AppHeaderSearch').type('Users{enter}');
cy.contains('Users Count');
});
});

6
package-lock.json generated
View File

@@ -5511,6 +5511,12 @@
}
}
},
"eslint-plugin-chai-friendly": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.4.1.tgz",
"integrity": "sha512-hkpLN7VVoGGsofZjUhcQ+sufC3FgqMJwD0DvAcRfxY1tVRyQyVsqpaKnToPHJQOrRo0FQ0fSEDwW2gr4rsNdGA==",
"dev": true
},
"eslint-plugin-cypress": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.2.1.tgz",

View File

@@ -11,8 +11,8 @@
"watch": "webpack --watch --progress --colors -d",
"analyze": "npm run clean && BUNDLE_ANALYZER=on webpack",
"analyze:build": "npm run clean && NODE_ENV=production BUNDLE_ANALYZER=on webpack",
"lint": "npm run lint:base -- --ext .js --ext .jsx ./client/app",
"lint:base": "eslint --config ./client/.eslintrc.js",
"lint": "npm run lint:base -- --ext .js --ext .jsx ./client",
"lint:base": "eslint --config ./client/.eslintrc.js --ignore-path ./client/.eslintignore",
"test": "TZ=Africa/Khartoum jest",
"test:watch": "jest --watch",
"cypress:install": "npm install --no-save cypress@^3.1.5 @percy/cypress@^0.2.3 atob@2.1.2",
@@ -102,6 +102,7 @@
"eslint-config-airbnb": "^17.1.0",
"eslint-import-resolver-webpack": "^0.8.3",
"eslint-loader": "^2.1.1",
"eslint-plugin-chai-friendly": "^0.4.1",
"eslint-plugin-cypress": "^2.0.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^22.2.2",
@@ -159,7 +160,6 @@
"npm run lint:base",
"npm run test -- --bail --findRelatedTests"
]
},
"ignore": ["client/dist/*"]
}
}
}