diff --git a/.eslintrc b/.eslintrc index 86918b9d925b..334f46159f23 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,8 +1,10 @@ --- -extends: '@elastic/kibana' +extends: + - '@elastic/eslint-config-kibana' + - '@elastic/eslint-config-kibana/jest' settings: import/resolver: '@elastic/eslint-import-resolver-kibana': rootPackageName: 'kibana' - kibanaPath: . \ No newline at end of file + kibanaPath: . diff --git a/package.json b/package.json index d78858fc4877..8207cc99ee2a 100644 --- a/package.json +++ b/package.json @@ -203,7 +203,7 @@ "yauzl": "2.7.0" }, "devDependencies": { - "@elastic/eslint-config-kibana": "0.8.1", + "@elastic/eslint-config-kibana": "0.9.0", "@elastic/eslint-import-resolver-kibana": "0.8.1", "@elastic/eslint-plugin-kibana-custom": "1.0.3", "angular-mocks": "1.4.7", diff --git a/src/core_plugins/metrics/server/lib/vis_data/__tests__/helpers/parse_settings.js b/src/core_plugins/metrics/server/lib/vis_data/__tests__/helpers/parse_settings.js index ce62a61a9e06..c81adee08ca8 100644 --- a/src/core_plugins/metrics/server/lib/vis_data/__tests__/helpers/parse_settings.js +++ b/src/core_plugins/metrics/server/lib/vis_data/__tests__/helpers/parse_settings.js @@ -16,13 +16,6 @@ describe('parseSettings', () => { }); }); - it('returns the true for "true"', () => { - const settings = 'pad=true'; - expect(parseSettings(settings)).to.eql({ - pad: true, - }); - }); - it('returns the true for 1', () => { const settings = 'pad=1'; expect(parseSettings(settings)).to.eql({ diff --git a/src/core_plugins/table_vis/public/__tests__/_table_vis_controller.js b/src/core_plugins/table_vis/public/__tests__/_table_vis_controller.js index 6f458fa3aa41..4500b8d6f21d 100644 --- a/src/core_plugins/table_vis/public/__tests__/_table_vis_controller.js +++ b/src/core_plugins/table_vis/public/__tests__/_table_vis_controller.js @@ -160,30 +160,4 @@ describe('Controller', function () { expect(spiedTabify).to.have.property('callCount', 1); expect(spiedTabify.firstCall.args[2]).to.have.property('partialRows', false); }); - - it('passes partialRows:true to tabify based on the vis params', function () { - // spy on the tabify private module - const spiedTabify = sinon.spy(Private(AggResponseTabifyProvider)); - Private.stub(AggResponseTabifyProvider, spiedTabify); - - const vis = new OneRangeVis({ showPartialRows: true }); - initController(vis); - attachEsResponseToScope(fixtures.oneRangeBucket); - - expect(spiedTabify).to.have.property('callCount', 1); - expect(spiedTabify.firstCall.args[2]).to.have.property('partialRows', true); - }); - - it('passes partialRows:false to tabify based on the vis params', function () { - // spy on the tabify private module - const spiedTabify = sinon.spy(Private(AggResponseTabifyProvider)); - Private.stub(AggResponseTabifyProvider, spiedTabify); - - const vis = new OneRangeVis({ showPartialRows: false }); - initController(vis); - attachEsResponseToScope(fixtures.oneRangeBucket); - - expect(spiedTabify).to.have.property('callCount', 1); - expect(spiedTabify.firstCall.args[2]).to.have.property('partialRows', false); - }); }); diff --git a/src/core_plugins/timelion/server/series_functions/__tests__/condition.js b/src/core_plugins/timelion/server/series_functions/__tests__/condition.js index d1ffead1aaab..96236853c270 100644 --- a/src/core_plugins/timelion/server/series_functions/__tests__/condition.js +++ b/src/core_plugins/timelion/server/series_functions/__tests__/condition.js @@ -39,19 +39,19 @@ describe(filename, function () { }); }); - it('eq', function () { + it('gt', function () { return invoke(fn, [seriesList, 'gt', 17, 0]).then(function (r) { expect(_.map(r.output.list[0].data, 1)).to.eql([-51, 17, 0, 0]); }); }); - it('eq', function () { + it('lt', function () { return invoke(fn, [seriesList, 'lt', 17, 0]).then(function (r) { expect(_.map(r.output.list[0].data, 1)).to.eql([0, 17, 82, 20]); }); }); - it('eq', function () { + it('lte', function () { return invoke(fn, [seriesList, 'lte', 17, 0]).then(function (r) { expect(_.map(r.output.list[0].data, 1)).to.eql([0, 0, 82, 20]); }); diff --git a/src/server/mappings/lib/__tests__/get_property.js b/src/server/mappings/lib/__tests__/get_property.js index d4d3067f00b3..905a7e332ab0 100644 --- a/src/server/mappings/lib/__tests__/get_property.js +++ b/src/server/mappings/lib/__tests__/get_property.js @@ -52,7 +52,7 @@ describe('getProperty(mappings, path)', () => { test('bar.baz.box', MAPPINGS.rootType.properties.bar.properties.baz.fields.box); }); }); - describe('string key', () => { + describe('array of string keys', () => { it('finds root properties', () => { test(['foo'], MAPPINGS.rootType.properties.foo); }); diff --git a/src/ui/public/state_management/state_hashing/__tests__/hash_url.js b/src/ui/public/state_management/state_hashing/__tests__/hash_url.js index debae21077d2..4909d007218e 100644 --- a/src/ui/public/state_management/state_hashing/__tests__/hash_url.js +++ b/src/ui/public/state_management/state_hashing/__tests__/hash_url.js @@ -75,11 +75,6 @@ describe('hashUrl', function () { expect(hashUrl(states, url)).to.be(url); }); - it('if empty hash without query', () => { - const url = 'https://localhost:5601/app/kibana#'; - expect(hashUrl(states, url)).to.be(url); - }); - it('if hash is just a path', () => { const url = 'https://localhost:5601/app/kibana#/discover'; expect(hashUrl(states, url)).to.be(url); diff --git a/src/ui/public/state_management/state_hashing/__tests__/unhash_url.js b/src/ui/public/state_management/state_hashing/__tests__/unhash_url.js index 56cc2444fa9c..6bbd9da4f37a 100644 --- a/src/ui/public/state_management/state_hashing/__tests__/unhash_url.js +++ b/src/ui/public/state_management/state_hashing/__tests__/unhash_url.js @@ -49,11 +49,6 @@ describe('unhashUrl', () => { expect(unhashUrl(url, unhashableStates)).to.be(url); }); - it('if empty hash without query', () => { - const url = 'https://localhost:5601/app/kibana#'; - expect(unhashUrl(url, unhashableStates)).to.be(url); - }); - it('if hash is just a path', () => { const url = 'https://localhost:5601/app/kibana#/discover'; expect(unhashUrl(url, unhashableStates)).to.be(url); diff --git a/src/ui/public/utils/lodash-mixins/__tests__/_move.js b/src/ui/public/utils/lodash-mixins/__tests__/_move.js index f80dc56ee586..d9dc9650cf5a 100644 --- a/src/ui/public/utils/lodash-mixins/__tests__/_move.js +++ b/src/ui/public/utils/lodash-mixins/__tests__/_move.js @@ -109,7 +109,7 @@ describe('_.move', function () { }); - it('moves an object up based on a where callback', function () { + it('moves an object down based on a where callback', function () { const list = [ { v: 1 }, { v: 1 }, diff --git a/src/ui/public/vis/__tests__/_agg_config.js b/src/ui/public/vis/__tests__/_agg_config.js index f0a21d8d952c..123ed914368d 100644 --- a/src/ui/public/vis/__tests__/_agg_config.js +++ b/src/ui/public/vis/__tests__/_agg_config.js @@ -128,7 +128,7 @@ describe('AggConfig', function () { expect(objs[3]).to.have.property('id', '4'); }); - it('assigns ids relative to the other items in the list', function () { + it('assigns ids relative to the other only item in the list', function () { const objs = [ { id: '100' }, {}, diff --git a/src/ui/public/vislib/__tests__/lib/data.js b/src/ui/public/vislib/__tests__/lib/data.js index 45421b21edca..d910b5e908d9 100644 --- a/src/ui/public/vislib/__tests__/lib/data.js +++ b/src/ui/public/vislib/__tests__/lib/data.js @@ -155,8 +155,8 @@ describe('Vislib Data Class Test Suite', function () { }); it('should return all points from every series', testLength(seriesData)); - it('should return all points from every series', testLength(rowsData)); - it('should return all points from every series', testLength(colsData)); + it('should return all points from every series in the rows', testLength(rowsData)); + it('should return all points from every series in the columns', testLength(colsData)); function testLength(inputData) { return function () { diff --git a/test/api_integration/apis/scripts/languages.js b/test/api_integration/apis/scripts/languages.js index 27fa54354409..ae2707df2fc6 100644 --- a/test/api_integration/apis/scripts/languages.js +++ b/test/api_integration/apis/scripts/languages.js @@ -12,6 +12,7 @@ export default function ({ getService }) { }) )); + // eslint-disable-next-line jest/no-disabled-tests it.skip('should only return langs enabled for inline scripting', () => ( supertest.get('/api/kibana/scripts/languages') .expect(200) diff --git a/test/functional/apps/discover/_shared_links.js b/test/functional/apps/discover/_shared_links.js index 4ac2c4d21ba9..4ff1f1698c04 100644 --- a/test/functional/apps/discover/_shared_links.js +++ b/test/functional/apps/discover/_shared_links.js @@ -115,7 +115,7 @@ export default function ({ getService, getPageObjects }) { }); // NOTE: This test has to run immediately after the test above - it('should show toast message for copy to clipboard', function () { + it('should show toast message for copy to clipboard of short URL', function () { return PageObjects.discover.clickCopyToClipboard() .then(function () { return PageObjects.header.getToastMessage(); diff --git a/ui_framework/.eslintrc b/ui_framework/.eslintrc deleted file mode 100644 index e20f52514131..000000000000 --- a/ui_framework/.eslintrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "plugins": [ - "jest" - ], - "rules": { - "jest/no-disabled-tests": "error", - "jest/no-focused-tests": "error", - "jest/no-identical-title": "error" - }, - "env": { - "jest/globals": true - } -}