[7.x] [jest] disallow invalid describe calls (#41378) (#41483)

* [jest] disallow invalid describe calls

* correct other describe calls

* remove unnecessary glob

* cast decribe names to strings

* remove new async describe function

# Conflicts:
#	x-pack/legacy/plugins/index_management/__jest__/client_integration/home.test.ts
#	x-pack/test/functional/apps/uptime/monitor.ts
This commit is contained in:
Spencer 2019-07-18 15:25:50 -07:00 committed by GitHub
parent 7995d77f49
commit 68f14413a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
60 changed files with 103 additions and 93 deletions

View file

@ -376,6 +376,16 @@ module.exports = {
}, },
}, },
/**
* Jest specific rules
*/
{
files: ['**/*.test.{js,ts,tsx}'],
rules: {
'jest/valid-describe': 'error',
},
},
/** /**
* APM overrides * APM overrides
*/ */

View file

@ -224,7 +224,7 @@ describe('#topologicallyBatchProjects', () => {
expect(expectedBatches).toMatchSnapshot(); expect(expectedBatches).toMatchSnapshot();
}); });
describe('batchByWorkspace = true', async () => { describe('batchByWorkspace = true', () => {
test('batches projects topologically based on their project dependencies and workspaces', async () => { test('batches projects topologically based on their project dependencies and workspaces', async () => {
const batches = topologicallyBatchProjects(projects, graph, { batchByWorkspace: true }); const batches = topologicallyBatchProjects(projects, graph, { batchByWorkspace: true });

View file

@ -56,7 +56,7 @@ describe('KuiButton', () => {
describe('Props', () => { describe('Props', () => {
describe('buttonType', () => { describe('buttonType', () => {
BUTTON_TYPES.forEach(buttonType => { BUTTON_TYPES.forEach(buttonType => {
describe(buttonType, () => { describe(`${buttonType}`, () => {
test(`renders the ${buttonType} class`, () => { test(`renders the ${buttonType} class`, () => {
const $button = render( const $button = render(
<KuiButton <KuiButton

View file

@ -42,7 +42,7 @@ describe('KuiButtonIcon', () => {
describe('Props', () => { describe('Props', () => {
describe('type', () => { describe('type', () => {
ICON_TYPES.forEach(type => { ICON_TYPES.forEach(type => {
describe(type, () => { describe(`${type}`, () => {
test(`renders the ${type} class`, () => { test(`renders the ${type} class`, () => {
const $buttonIcon = render(<KuiButtonIcon type={type} />); const $buttonIcon = render(<KuiButtonIcon type={type} />);
expect($buttonIcon).toMatchSnapshot(); expect($buttonIcon).toMatchSnapshot();

View file

@ -57,7 +57,7 @@ describe('KuiLinkButton', () => {
describe('Props', () => { describe('Props', () => {
describe('buttonType', () => { describe('buttonType', () => {
BUTTON_TYPES.forEach(buttonType => { BUTTON_TYPES.forEach(buttonType => {
describe(buttonType, () => { describe(`${buttonType}`, () => {
test(`renders the ${buttonType} class`, () => { test(`renders the ${buttonType} class`, () => {
const $button = render( const $button = render(
<KuiLinkButton <KuiLinkButton

View file

@ -55,7 +55,7 @@ describe('KuiSubmitButton', () => {
describe('Props', () => { describe('Props', () => {
describe('buttonType', () => { describe('buttonType', () => {
BUTTON_TYPES.forEach(buttonType => { BUTTON_TYPES.forEach(buttonType => {
describe(buttonType, () => { describe(`${buttonType}`, () => {
test(`renders the ${buttonType} class`, () => { test(`renders the ${buttonType} class`, () => {
const $button = render(<KuiSubmitButton buttonType={buttonType} />); const $button = render(<KuiSubmitButton buttonType={buttonType} />);
expect($button).toMatchSnapshot(); expect($button).toMatchSnapshot();

View file

@ -31,7 +31,7 @@ describe('KuiCollapseButton', () => {
describe('Props', () => { describe('Props', () => {
describe('direction', () => { describe('direction', () => {
DIRECTIONS.forEach(direction => { DIRECTIONS.forEach(direction => {
describe(direction, () => { describe(`${direction}`, () => {
test(`renders the ${direction} class`, () => { test(`renders the ${direction} class`, () => {
const component = <KuiCollapseButton direction={direction} {...requiredProps}/>; const component = <KuiCollapseButton direction={direction} {...requiredProps}/>;
expect(render(component)).toMatchSnapshot(); expect(render(component)).toMatchSnapshot();

View file

@ -219,7 +219,7 @@ describe('filter_manager', () => {
}); });
}); });
describe('add filters', async () => { describe('add filters', () => {
test('app state should accept a single filter', async function() { test('app state should accept a single filter', async function() {
updateSubscription = filterManager.getUpdates$().subscribe(updateListener); updateSubscription = filterManager.getUpdates$().subscribe(updateListener);
const f1 = getFilter(FilterStateStore.APP_STATE, false, false, 'age', 34); const f1 = getFilter(FilterStateStore.APP_STATE, false, false, 'age', 34);
@ -535,7 +535,7 @@ describe('filter_manager', () => {
}); });
}); });
describe('remove filters', async () => { describe('remove filters', () => {
test('remove on empty should do nothing and not fire events', async () => { test('remove on empty should do nothing and not fire events', async () => {
updateSubscription = filterManager.getUpdates$().subscribe(updateListener); updateSubscription = filterManager.getUpdates$().subscribe(updateListener);
await filterManager.removeAll(); await filterManager.removeAll();

View file

@ -81,7 +81,7 @@ describe('headers', () => {
return JSON.parse(requestParts[0]); return JSON.parse(requestParts[0]);
}; };
describe('search request preference', async () => { describe('search request preference', () => {
test('should be set to sessionId when courier:setRequestPreference is "sessionId"', async () => { test('should be set to sessionId when courier:setRequestPreference is "sessionId"', async () => {
const config = { const config = {
get: () => { get: () => {

View file

@ -133,7 +133,7 @@ describe('kfetch', () => {
} }
}); });
describe('when throwing response error (KFetchError)', async () => { describe('when throwing response error (KFetchError)', () => {
let error: KFetchError; let error: KFetchError;
beforeEach(async () => { beforeEach(async () => {
fetchMock.get('*', { status: 404, body: { foo: 'bar' } }); fetchMock.get('*', { status: 404, body: { foo: 'bar' } });
@ -348,7 +348,7 @@ describe('kfetch', () => {
}); });
}); });
describe('when interceptors return synchronously', async () => { describe('when interceptors return synchronously', () => {
let resp: any; let resp: any;
beforeEach(async () => { beforeEach(async () => {
fetchMock.get('*', { foo: 'bar' }); fetchMock.get('*', { foo: 'bar' });
@ -381,7 +381,7 @@ describe('kfetch', () => {
}); });
}); });
describe('when interceptors return promise', async () => { describe('when interceptors return promise', () => {
let resp: any; let resp: any;
beforeEach(async () => { beforeEach(async () => {
fetchMock.get('*', { foo: 'bar' }); fetchMock.get('*', { foo: 'bar' });

View file

@ -52,7 +52,7 @@ export default function ({ getService }) {
const getSavedObjectTypesQuery = types => coerceToArray(types).map(type => `savedObjectTypes=${type}`).join('&'); const getSavedObjectTypesQuery = types => coerceToArray(types).map(type => `savedObjectTypes=${type}`).join('&');
const defaultQuery = getSavedObjectTypesQuery(['visualization', 'index-pattern', 'search', 'dashboard']); const defaultQuery = getSavedObjectTypesQuery(['visualization', 'index-pattern', 'search', 'dashboard']);
describe('searches', async () => { describe('searches', () => {
it('should validate search response schema', async () => { it('should validate search response schema', async () => {
await supertest await supertest
.get(`${baseApiUrl}/search/960372e0-3224-11e8-a572-ffca06da1357?${defaultQuery}`) .get(`${baseApiUrl}/search/960372e0-3224-11e8-a572-ffca06da1357?${defaultQuery}`)
@ -145,7 +145,7 @@ export default function ({ getService }) {
}); });
}); });
describe('dashboards', async () => { describe('dashboards', () => {
it('should validate dashboard response schema', async () => { it('should validate dashboard response schema', async () => {
await supertest await supertest
.get(`${baseApiUrl}/dashboard/b70c7ae0-3224-11e8-a572-ffca06da1357?${defaultQuery}`) .get(`${baseApiUrl}/dashboard/b70c7ae0-3224-11e8-a572-ffca06da1357?${defaultQuery}`)
@ -240,7 +240,7 @@ export default function ({ getService }) {
}); });
}); });
describe('visualizations', async () => { describe('visualizations', () => {
it('should validate visualization response schema', async () => { it('should validate visualization response schema', async () => {
await supertest await supertest
.get(`${baseApiUrl}/visualization/a42c0580-3224-11e8-a572-ffca06da1357?${defaultQuery}`) .get(`${baseApiUrl}/visualization/a42c0580-3224-11e8-a572-ffca06da1357?${defaultQuery}`)
@ -320,7 +320,7 @@ export default function ({ getService }) {
}); });
}); });
describe('index patterns', async () => { describe('index patterns', () => {
it('should validate visualization response schema', async () => { it('should validate visualization response schema', async () => {
await supertest await supertest
.get(`${baseApiUrl}/index-pattern/8963ca30-3224-11e8-a572-ffca06da1357?${defaultQuery}`) .get(`${baseApiUrl}/index-pattern/8963ca30-3224-11e8-a572-ffca06da1357?${defaultQuery}`)

View file

@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }) {
const browser = getService('browser'); const browser = getService('browser');
const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardAddPanel = getService('dashboardAddPanel');
describe('create and add embeddables', async () => { describe('create and add embeddables', () => {
before(async () => { before(async () => {
await PageObjects.dashboard.loadSavedDashboard('few panels'); await PageObjects.dashboard.loadSavedDashboard('few panels');
}); });

View file

@ -27,12 +27,12 @@ export default function ({ getService, getPageObjects }) {
const pieChart = getService('pieChart'); const pieChart = getService('pieChart');
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize']); const PageObjects = getPageObjects(['dashboard', 'header', 'visualize']);
describe('dashboard filter bar', async () => { describe('dashboard filter bar', () => {
before(async () => { before(async () => {
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();
}); });
describe('Add a filter bar', async function () { describe('Add a filter bar', function () {
before(async () => { before(async () => {
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();
}); });
@ -50,7 +50,7 @@ export default function ({ getService, getPageObjects }) {
}); });
}); });
describe('filter editor field list', async function () { describe('filter editor field list', function () {
this.tags(['skipFirefox']); this.tags(['skipFirefox']);
before(async () => { before(async () => {
@ -80,7 +80,7 @@ export default function ({ getService, getPageObjects }) {
}); });
}); });
describe('filter pills', async function () { describe('filter pills', function () {
before(async () => { before(async () => {
await filterBar.ensureFieldEditorModalIsClosed(); await filterBar.ensureFieldEditorModalIsClosed();
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();

View file

@ -34,13 +34,13 @@ export default function ({ getService, getPageObjects }) {
const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardPanelActions = getService('dashboardPanelActions');
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize']); const PageObjects = getPageObjects(['dashboard', 'header', 'visualize']);
describe('dashboard filtering', async function () { describe('dashboard filtering', function () {
this.tags('smoke'); this.tags('smoke');
before(async () => { before(async () => {
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();
}); });
describe('adding a filter that excludes all data', async () => { describe('adding a filter that excludes all data', () => {
before(async () => { before(async () => {
await PageObjects.dashboard.clickNewDashboard(); await PageObjects.dashboard.clickNewDashboard();
await PageObjects.dashboard.setTimepickerInDataRange(); await PageObjects.dashboard.setTimepickerInDataRange();
@ -107,7 +107,7 @@ export default function ({ getService, getPageObjects }) {
}); });
}); });
describe('using a pinned filter that excludes all data', async () => { describe('using a pinned filter that excludes all data', () => {
before(async () => { before(async () => {
await filterBar.toggleFilterPinned('bytes'); await filterBar.toggleFilterPinned('bytes');
await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.header.waitUntilLoadingHasFinished();
@ -169,7 +169,7 @@ export default function ({ getService, getPageObjects }) {
}); });
}); });
describe('disabling a filter unfilters the data on', async () => { describe('disabling a filter unfilters the data on', () => {
before(async () => { before(async () => {
await filterBar.toggleFilterEnabled('bytes'); await filterBar.toggleFilterEnabled('bytes');
await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.header.waitUntilLoadingHasFinished();
@ -227,7 +227,7 @@ export default function ({ getService, getPageObjects }) {
}); });
}); });
describe('nested filtering', async () => { describe('nested filtering', () => {
before(async () => { before(async () => {
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();
}); });

View file

@ -30,7 +30,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.dashboard.initTests(); await PageObjects.dashboard.initTests();
}); });
describe('create prompt', async () => { describe('create prompt', () => {
it('appears when there are no dashboards', async function () { it('appears when there are no dashboards', async function () {
const promptExists = await PageObjects.dashboard.getCreateDashboardPromptExists(); const promptExists = await PageObjects.dashboard.getCreateDashboardPromptExists();
expect(promptExists).to.be(true); expect(promptExists).to.be(true);
@ -59,7 +59,7 @@ export default function ({ getService, getPageObjects }) {
}); });
}); });
describe('delete', async function () { describe('delete', function () {
it('default confirm action is cancel', async function () { it('default confirm action is cancel', async function () {
await PageObjects.dashboard.searchForDashboardWithName(dashboardName); await PageObjects.dashboard.searchForDashboardWithName(dashboardName);
await PageObjects.dashboard.checkDashboardListingSelectAllCheckbox(); await PageObjects.dashboard.checkDashboardListingSelectAllCheckbox();

View file

@ -23,7 +23,7 @@ export default function ({ getService, getPageObjects }) {
const retry = getService('retry'); const retry = getService('retry');
const PageObjects = getPageObjects(['dashboard']); const PageObjects = getPageObjects(['dashboard']);
describe('dashboard data-shared attributes', async () => { describe('dashboard data-shared attributes', () => {
let originalTitles = []; let originalTitles = [];
before(async () => { before(async () => {

View file

@ -25,7 +25,7 @@ export default function ({ getService, getPageObjects }) {
const queryBar = getService('queryBar'); const queryBar = getService('queryBar');
const PageObjects = getPageObjects(['dashboard', 'discover']); const PageObjects = getPageObjects(['dashboard', 'discover']);
describe('dashboard query bar', async () => { describe('dashboard query bar', () => {
before(async () => { before(async () => {
await PageObjects.dashboard.loadSavedDashboard('dashboard with filter'); await PageObjects.dashboard.loadSavedDashboard('dashboard with filter');
}); });

View file

@ -56,7 +56,7 @@ export default function ({ getPageObjects, getService }) {
}); });
}); });
describe('dashboard with stored timed', async function () { describe('dashboard with stored timed', function () {
it('is saved with time', async function () { it('is saved with time', async function () {
await PageObjects.dashboard.switchToEditMode(); await PageObjects.dashboard.switchToEditMode();
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);

View file

@ -24,7 +24,7 @@ export default function ({ getService, getPageObjects }) {
const PageObjects = getPageObjects(['dashboard', 'common']); const PageObjects = getPageObjects(['dashboard', 'common']);
const browser = getService('browser'); const browser = getService('browser');
describe('embed mode', async () => { describe('embed mode', () => {
before(async () => { before(async () => {
await PageObjects.dashboard.loadSavedDashboard('few panels'); await PageObjects.dashboard.loadSavedDashboard('few panels');
}); });

View file

@ -24,7 +24,7 @@ export default function ({ getService, getPageObjects }) {
const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardAddPanel = getService('dashboardAddPanel');
const PageObjects = getPageObjects(['dashboard']); const PageObjects = getPageObjects(['dashboard']);
describe('empty dashboard', async () => { describe('empty dashboard', () => {
before(async () => { before(async () => {
await PageObjects.dashboard.clickNewDashboard(); await PageObjects.dashboard.clickNewDashboard();
}); });

View file

@ -25,7 +25,7 @@ export default function ({ getService, getPageObjects }) {
const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardPanelActions = getService('dashboardPanelActions');
const PageObjects = getPageObjects(['dashboard', 'common']); const PageObjects = getPageObjects(['dashboard', 'common']);
describe('full screen mode', async () => { describe('full screen mode', () => {
before(async () => { before(async () => {
await PageObjects.dashboard.loadSavedDashboard('few panels'); await PageObjects.dashboard.loadSavedDashboard('few panels');
}); });

View file

@ -53,7 +53,7 @@ export default function ({ getService, getPageObjects }) {
}); });
}); });
describe('shows lose changes warning', async function () { describe('shows lose changes warning', function () {
describe('and loses changes on confirmation', function () { describe('and loses changes on confirmation', function () {
beforeEach(async function () { beforeEach(async function () {
await PageObjects.dashboard.gotoDashboardEditMode(dashboardName); await PageObjects.dashboard.gotoDashboardEditMode(dashboardName);
@ -193,7 +193,7 @@ export default function ({ getService, getPageObjects }) {
}); });
}); });
describe('Does not show lose changes warning', async function () { describe('Does not show lose changes warning', function () {
it('when time changed is not stored with dashboard', async function () { it('when time changed is not stored with dashboard', async function () {
await PageObjects.dashboard.gotoDashboardEditMode(dashboardName); await PageObjects.dashboard.gotoDashboardEditMode(dashboardName);
await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: false }); await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: false });

View file

@ -380,7 +380,7 @@ export default function ({ getService, getPageObjects }) {
} }
}); });
describe('query #2, which has an empty time range', async () => { describe('query #2, which has an empty time range', () => {
const fromTime = '1999-06-11 09:22:11.000'; const fromTime = '1999-06-11 09:22:11.000';
const toTime = '1999-06-12 11:21:04.000'; const toTime = '1999-06-12 11:21:04.000';
@ -401,7 +401,7 @@ export default function ({ getService, getPageObjects }) {
}); });
}); });
describe('filter editor', async function () { describe('filter editor', function () {
it('should add a phrases filter', async function () { it('should add a phrases filter', async function () {
await filterBar.addFilter('extension.raw', 'is one of', 'jpg'); await filterBar.addFilter('extension.raw', 'is one of', 'jpg');
expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true); expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true);

View file

@ -29,7 +29,7 @@ export default function ({ getPageObjects, getService }) {
<h3>Inline HTML that should not be rendered as html</h3> <h3>Inline HTML that should not be rendered as html</h3>
`; `;
describe('visualize app', async () => { describe('visualize app', () => {
before(async function () { before(async function () {
await PageObjects.visualize.navigateToNewVisualization(); await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickMarkdownWidget(); await PageObjects.visualize.clickMarkdownWidget();
@ -37,7 +37,7 @@ export default function ({ getPageObjects, getService }) {
await PageObjects.visualize.clickGo(); await PageObjects.visualize.clickGo();
}); });
describe('markdown vis', async () => { describe('markdown vis', () => {
it('should not have inspector enabled', async function () { it('should not have inspector enabled', async function () {
await inspector.expectIsNotEnabled(); await inspector.expectIsNotEnabled();

View file

@ -28,7 +28,7 @@ export default function ({ getService, getPageObjects }) {
const fromTime = '2015-09-19 06:31:44.000'; const fromTime = '2015-09-19 06:31:44.000';
const toTime = '2015-09-23 18:31:44.000'; const toTime = '2015-09-23 18:31:44.000';
describe('pie chart', async function () { describe('pie chart', function () {
const vizName1 = 'Visualization PieChart'; const vizName1 = 'Visualization PieChart';
before(async function () { before(async function () {
log.debug('navigateToApp visualize'); log.debug('navigateToApp visualize');

View file

@ -184,7 +184,7 @@ export default function ({ getService, getPageObjects }) {
}); });
}); });
describe('timezones', async function () { describe('timezones', function () {
const expectedLabels = [ const expectedLabels = [
'2015-09-20 00:00', '2015-09-20 00:00',
'2015-09-21 00:00', '2015-09-21 00:00',

View file

@ -209,7 +209,7 @@ export default function ({ getService, getPageObjects }) {
}); });
describe('Only request data around extent of map option', async () => { describe('Only request data around extent of map option', () => {
it('when checked adds filters to aggregation', async () => { it('when checked adds filters to aggregation', async () => {
const vizName1 = 'Visualization TileMap'; const vizName1 = 'Visualization TileMap';

View file

@ -25,7 +25,7 @@ export default function ({ getPageObjects }) {
describe('visualize listing page', function describeIndexTests() { describe('visualize listing page', function describeIndexTests() {
const vizName = 'Visualize Listing Test'; const vizName = 'Visualize Listing Test';
describe('create and delete', async function () { describe('create and delete', function () {
before(async function () { before(async function () {
await PageObjects.visualize.gotoVisualizationLandingPage(); await PageObjects.visualize.gotoVisualizationLandingPage();

View file

@ -7,7 +7,7 @@
import { migrations } from './migrations'; import { migrations } from './migrations';
import { CANVAS_TYPE } from './common/lib'; import { CANVAS_TYPE } from './common/lib';
describe(CANVAS_TYPE, () => { describe(`${CANVAS_TYPE}`, () => {
describe('7.0.0', () => { describe('7.0.0', () => {
const migrate = doc => migrations[CANVAS_TYPE]['7.0.0'](doc); const migrate = doc => migrations[CANVAS_TYPE]['7.0.0'](doc);

View file

@ -252,7 +252,7 @@ Array [
}); });
}); });
describe(`GET ${routePrefix}/find`, async () => { it(`GET ${routePrefix}/find`, async () => {
const request = { const request = {
method: 'GET', method: 'GET',
url: `${routePrefix}/find?name=abc&page=2&perPage=10`, url: `${routePrefix}/find?name=abc&page=2&perPage=10`,

View file

@ -76,7 +76,7 @@ describe('<AutoFollowPatternList />', () => {
}); });
}); });
describe('when there are auto-follow patterns', async () => { describe('when there are auto-follow patterns', () => {
let find; let find;
let exists; let exists;
let component; let component;

View file

@ -74,7 +74,7 @@ describe('<FollowerIndicesList />', () => {
}); });
}); });
describe('when there are follower indices', async () => { describe('when there are follower indices', () => {
let find; let find;
let exists; let exists;
let component; let component;

View file

@ -45,7 +45,7 @@ describe('license_pre_routing_factory', () => {
}); });
}); });
describe('isAvailable is true', async () => { describe('isAvailable is true', () => {
beforeEach(() => { beforeEach(() => {
mockLicenseCheckResults = { mockLicenseCheckResults = {
isAvailable: true isAvailable: true

View file

@ -45,7 +45,7 @@ const mockTooltipProperties = [
new MockTooltipProperty('prop2', 'foobar2', false) new MockTooltipProperty('prop2', 'foobar2', false)
]; ];
describe('FeatureProperties', async () => { describe('FeatureProperties', () => {
test('should not show filter button', async () => { test('should not show filter button', async () => {
const component = shallow( const component = shallow(

View file

@ -52,7 +52,7 @@ const defaultProps = {
isLocked: false isLocked: false
}; };
describe('FeatureTooltip (single)', async () => { describe('FeatureTooltip (single)', () => {
test('should not show close button', async () => { test('should not show close button', async () => {
const component = shallow( const component = shallow(
@ -91,7 +91,7 @@ describe('FeatureTooltip (single)', async () => {
}); });
describe('FeatureTooltip (multi)', async () => { describe('FeatureTooltip (multi)', () => {
test('should not show close button / should show count', async () => { test('should not show close button / should show count', async () => {
const component = shallow( const component = shallow(

View file

@ -129,7 +129,7 @@ describe('Elasticsearch Settings Find Reason for No Data', () => {
expect(result).to.eql({ found: false }); expect(result).to.eql({ found: false });
}); });
describe('exporters', async () => { describe('exporters', () => {
it('should warn if all exporters are disabled', async () => { it('should warn if all exporters are disabled', async () => {
const input = { const input = {
exporters: { exporters: {

View file

@ -60,7 +60,7 @@ describe('<RemoteClusterList />', () => {
}); });
}); });
describe('when there are remote clusters', async () => { describe('when there are remote clusters', () => {
let find; let find;
let exists; let exists;
let component; let component;

View file

@ -296,7 +296,7 @@ describe('CSV Execute Job', function () {
}); });
}); });
describe('Cells with formula values', async () => { describe('Cells with formula values', () => {
it('returns `csv_contains_formulas` when cells contain formulas', async function () { it('returns `csv_contains_formulas` when cells contain formulas', async function () {
mockServer.config().get.withArgs('xpack.reporting.csv.checkForFormulas').returns(true); mockServer.config().get.withArgs('xpack.reporting.csv.checkForFormulas').returns(true);
callWithRequestStub.onFirstCall().returns({ callWithRequestStub.onFirstCall().returns({

View file

@ -228,7 +228,7 @@ describe(`when job is completed`, () => {
expect(headers['content-type']).toBe('application/pdf'); expect(headers['content-type']).toBe('application/pdf');
}); });
describe(`when non-whitelisted contentType specified in job output`, async () => { describe(`when non-whitelisted contentType specified in job output`, () => {
test(`sets statusCode to 500`, async () => { test(`sets statusCode to 500`, async () => {
const { statusCode } = await getCompletedResponse({ outputContentType: 'application/html' }); const { statusCode } = await getCompletedResponse({ outputContentType: 'application/html' });
expect(statusCode).toBe(500); expect(statusCode).toBe(500);

View file

@ -58,7 +58,7 @@ function getServerMock(customization) {
const getResponseMock = (customization = {}) => customization; const getResponseMock = (customization = {}) => customization;
describe('license checks', () => { describe('license checks', () => {
describe('with a basic license', async () => { describe('with a basic license', () => {
let usageStats; let usageStats;
beforeAll(async () => { beforeAll(async () => {
const serverWithBasicLicenseMock = getServerMock(); const serverWithBasicLicenseMock = getServerMock();
@ -83,7 +83,7 @@ describe('license checks', () => {
}); });
}); });
describe('with no license', async () => { describe('with no license', () => {
let usageStats; let usageStats;
beforeAll(async () => { beforeAll(async () => {
const serverWithNoLicenseMock = getServerMock(); const serverWithNoLicenseMock = getServerMock();
@ -108,7 +108,7 @@ describe('license checks', () => {
}); });
}); });
describe('with platinum license', async () => { describe('with platinum license', () => {
let usageStats; let usageStats;
beforeAll(async () => { beforeAll(async () => {
const serverWithPlatinumLicenseMock = getServerMock(); const serverWithPlatinumLicenseMock = getServerMock();
@ -135,7 +135,7 @@ describe('license checks', () => {
}); });
}); });
describe('with no usage data', async () => { describe('with no usage data', () => {
let usageStats; let usageStats;
beforeAll(async () => { beforeAll(async () => {
const serverWithBasicLicenseMock = getServerMock(); const serverWithBasicLicenseMock = getServerMock();

View file

@ -274,7 +274,7 @@ describe('features', () => {
expectGetFeatures: false, expectGetFeatures: false,
}, },
].forEach(({ group, expectManageSpaces, expectGetFeatures }) => { ].forEach(({ group, expectManageSpaces, expectGetFeatures }) => {
describe(group, () => { describe(`${group}`, () => {
test('actions defined only at the feature are included in `all` and `read`', () => { test('actions defined only at the feature are included in `all` and `read`', () => {
const features: Feature[] = [ const features: Feature[] = [
{ {

View file

@ -17,7 +17,7 @@ import '../../mock/ui_settings';
import { LastEventTime } from '.'; import { LastEventTime } from '.';
describe('Last Event Time Stat', async () => { describe('Last Event Time Stat', () => {
// this is just a little hack to silence a warning that we'll get until react // this is just a little hack to silence a warning that we'll get until react
// fixes this: https://github.com/facebook/react/pull/14853 // fixes this: https://github.com/facebook/react/pull/14853
// For us that mean we need to upgrade to 16.9.0 // For us that mean we need to upgrade to 16.9.0

View file

@ -19,7 +19,7 @@ import { createStore, hostsModel, networkModel, State } from '../../../store';
import { AddToKql } from '.'; import { AddToKql } from '.';
describe('AddToKql Component', async () => { describe('AddToKql Component', () => {
const state: State = mockGlobalState; const state: State = mockGlobalState;
let store = createStore(state, apolloClientObservable); let store = createStore(state, apolloClientObservable);

View file

@ -16,7 +16,7 @@ import '../../../../mock/ui_settings';
import { FirstLastSeenHost, FirstLastSeenHostType } from '.'; import { FirstLastSeenHost, FirstLastSeenHostType } from '.';
describe('FirstLastSeen Component', async () => { describe('FirstLastSeen Component', () => {
// this is just a little hack to silence a warning that we'll get until react // this is just a little hack to silence a warning that we'll get until react
// fixes this: https://github.com/facebook/react/pull/14853 // fixes this: https://github.com/facebook/react/pull/14853
// For us that mean we need to upgrade to 16.9.0 // For us that mean we need to upgrade to 16.9.0

View file

@ -21,7 +21,7 @@ describe('getDeprecationLoggingStatus', () => {
}); });
describe('setDeprecationLogging', () => { describe('setDeprecationLogging', () => {
describe('isEnabled = true', async () => { describe('isEnabled = true', () => {
it('calls cluster.putSettings with logger.deprecation = WARN', async () => { it('calls cluster.putSettings with logger.deprecation = WARN', async () => {
const callWithRequest = jest.fn(); const callWithRequest = jest.fn();
await setDeprecationLogging(callWithRequest, {} as any, true); await setDeprecationLogging(callWithRequest, {} as any, true);
@ -31,7 +31,7 @@ describe('setDeprecationLogging', () => {
}); });
}); });
describe('isEnabled = false', async () => { describe('isEnabled = false', () => {
it('calls cluster.putSettings with logger.deprecation = ERROR', async () => { it('calls cluster.putSettings with logger.deprecation = ERROR', async () => {
const callWithRequest = jest.fn(); const callWithRequest = jest.fn();
await setDeprecationLogging(callWithRequest, {} as any, false); await setDeprecationLogging(callWithRequest, {} as any, false);

View file

@ -33,7 +33,7 @@ export default function ({ getService }) {
}); });
}); });
describe('detail', async () => { describe('detail', () => {
it('should return the node stats when providing a custom node attribute', async () => { it('should return the node stats when providing a custom node attribute', async () => {
// Load the stats from ES js client // Load the stats from ES js client
const nodeStats = await getNodesStats(); const nodeStats = await getNodesStats();

View file

@ -267,7 +267,7 @@ export default function ({ getService }) {
}); });
}); });
describe('Get Role', async () => { describe('Get Role', () => {
it('should get roles', async () => { it('should get roles', async () => {
await es.shield.putRole({ await es.shield.putRole({
name: 'role_to_get', name: 'role_to_get',

View file

@ -14,7 +14,7 @@ export default function canvasSmokeTest({ getService, getPageObjects }) {
const retry = getService('retry'); const retry = getService('retry');
const PageObjects = getPageObjects(['common']); const PageObjects = getPageObjects(['common']);
describe('smoke test', async function () { describe('smoke test', function () {
this.tags('smoke'); this.tags('smoke');
const workpadListSelector = 'canvasWorkpadLoaderTable canvasWorkpadLoaderWorkpad'; const workpadListSelector = 'canvasWorkpadLoaderTable canvasWorkpadLoaderWorkpad';
const testWorkpadId = 'workpad-1705f884-6224-47de-ba49-ca224fe6ec31'; const testWorkpadId = 'workpad-1705f884-6224-47de-ba49-ca224fe6ec31';

View file

@ -117,7 +117,7 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
}); });
}); });
describe('space with Visualize disabled', async () => { describe('space with Visualize disabled', () => {
before(async () => { before(async () => {
// we need to load the following in every situation as deleting // we need to load the following in every situation as deleting
// a space deletes all of the associated saved objects // a space deletes all of the associated saved objects
@ -144,7 +144,7 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
}); });
}); });
describe('space with index pattern management disabled', async () => { describe('space with index pattern management disabled', () => {
before(async () => { before(async () => {
await spacesService.create({ await spacesService.create({
id: 'custom_space', id: 'custom_space',

View file

@ -31,7 +31,7 @@ export default function ({ getPageObjects, getService }) {
expect(mapboxStyle.sources[VECTOR_SOURCE_ID].data.features.length).to.equal(10); expect(mapboxStyle.sources[VECTOR_SOURCE_ID].data.features.length).to.equal(10);
}); });
describe('configuration', async () => { describe('configuration', () => {
before(async () => { before(async () => {
await PageObjects.maps.openLayerPanel('logstash'); await PageObjects.maps.openLayerPanel('logstash');
// Can not use testSubjects because data-test-subj is placed range input and number input // Can not use testSubjects because data-test-subj is placed range input and number input
@ -52,7 +52,7 @@ export default function ({ getPageObjects, getService }) {
}); });
}); });
describe('query', async () => { describe('query', () => {
before(async () => { before(async () => {
await PageObjects.maps.setAndSubmitQuery('machine.os.raw : "win 8"'); await PageObjects.maps.setAndSubmitQuery('machine.os.raw : "win 8"');
}); });

View file

@ -30,7 +30,7 @@ export default function ({ getPageObjects, getService }) {
function makeRequestTestsForGeoPrecision(LAYER_ID) { function makeRequestTestsForGeoPrecision(LAYER_ID) {
describe('geoprecision - requests', async () => { describe('geoprecision - requests', () => {
let beforeTimestamp; let beforeTimestamp;
beforeEach(async () => { beforeEach(async () => {
await PageObjects.maps.setView(DATA_CENTER_LAT, DATA_CENTER_LON, 1); await PageObjects.maps.setView(DATA_CENTER_LAT, DATA_CENTER_LON, 1);
@ -58,7 +58,7 @@ export default function ({ getPageObjects, getService }) {
}); });
}); });
describe('geotile grid precision - data', async ()=> { describe('geotile grid precision - data', ()=> {
beforeEach(async () => { beforeEach(async () => {
await PageObjects.maps.setView(DATA_CENTER_LAT, DATA_CENTER_LON, 1); await PageObjects.maps.setView(DATA_CENTER_LAT, DATA_CENTER_LON, 1);

View file

@ -16,7 +16,7 @@ export default function ({ getPageObjects }) {
await PageObjects.maps.loadSavedMap('layer with errors'); await PageObjects.maps.loadSavedMap('layer with errors');
}); });
describe('ESSearchSource with missing index pattern id', async () => { describe('ESSearchSource with missing index pattern id', () => {
const MISSING_INDEX_ID = 'idThatDoesNotExitForESSearchSource'; const MISSING_INDEX_ID = 'idThatDoesNotExitForESSearchSource';
const LAYER_NAME = MISSING_INDEX_ID; const LAYER_NAME = MISSING_INDEX_ID;
@ -33,7 +33,7 @@ export default function ({ getPageObjects }) {
}); });
}); });
describe('ESGeoGridSource with missing index pattern id', async () => { describe('ESGeoGridSource with missing index pattern id', () => {
const MISSING_INDEX_ID = 'idThatDoesNotExitForESGeoGridSource'; const MISSING_INDEX_ID = 'idThatDoesNotExitForESGeoGridSource';
const LAYER_NAME = MISSING_INDEX_ID; const LAYER_NAME = MISSING_INDEX_ID;
@ -49,7 +49,7 @@ export default function ({ getPageObjects }) {
}); });
}); });
describe('ESJoinSource with missing index pattern id', async () => { describe('ESJoinSource with missing index pattern id', () => {
const MISSING_INDEX_ID = 'idThatDoesNotExitForESJoinSource'; const MISSING_INDEX_ID = 'idThatDoesNotExitForESJoinSource';
const LAYER_NAME = 'geo_shapes*'; const LAYER_NAME = 'geo_shapes*';
@ -65,7 +65,7 @@ export default function ({ getPageObjects }) {
}); });
}); });
describe('EMSFileSource with missing EMS id', async () => { describe('EMSFileSource with missing EMS id', () => {
const MISSING_EMS_ID = 'idThatDoesNotExitForEMSFileSource'; const MISSING_EMS_ID = 'idThatDoesNotExitForEMSFileSource';
const LAYER_NAME = 'EMS_vector_shapes'; const LAYER_NAME = 'EMS_vector_shapes';
@ -81,7 +81,7 @@ export default function ({ getPageObjects }) {
}); });
}); });
describe('EMSTMSSource with missing EMS id', async () => { describe('EMSTMSSource with missing EMS id', () => {
const MISSING_EMS_ID = 'idThatDoesNotExitForEMSTile'; const MISSING_EMS_ID = 'idThatDoesNotExitForEMSTile';
const LAYER_NAME = 'EMS_tiles'; const LAYER_NAME = 'EMS_tiles';
@ -97,7 +97,7 @@ export default function ({ getPageObjects }) {
}); });
}); });
describe('KibanaRegionmapSource with missing region map configuration', async () => { describe('KibanaRegionmapSource with missing region map configuration', () => {
const MISSING_REGION_NAME = 'nameThatDoesNotExitForKibanaRegionmapSource'; const MISSING_REGION_NAME = 'nameThatDoesNotExitForKibanaRegionmapSource';
const LAYER_NAME = 'Custom_vector_shapes'; const LAYER_NAME = 'Custom_vector_shapes';
@ -113,7 +113,7 @@ export default function ({ getPageObjects }) {
}); });
}); });
describe('KibanaTilemapSource with missing map.tilemap.url configuration', async () => { describe('KibanaTilemapSource with missing map.tilemap.url configuration', () => {
const LAYER_NAME = 'Custom_TMS'; const LAYER_NAME = 'Custom_TMS';
it('should diplay error message in layer panel', async () => { it('should diplay error message in layer panel', async () => {

View file

@ -161,7 +161,7 @@ export default function ({ getService, getPageObjects }) {
}); });
}); });
describe('alert actions take you to the elasticsearch indices listing', async () => { describe('alert actions take you to the elasticsearch indices listing', () => {
const { setup, tearDown } = getLifecycleMethods(getService, getPageObjects); const { setup, tearDown } = getLifecycleMethods(getService, getPageObjects);
before(async () => { before(async () => {

View file

@ -12,7 +12,7 @@ export default function ({ getService, getPageObjects }) {
const log = getService('log'); const log = getService('log');
const PageObjects = getPageObjects(['security', 'rollup', 'common', 'header']); const PageObjects = getPageObjects(['security', 'rollup', 'common', 'header']);
describe('rollup job', async function () { describe('rollup job', function () {
this.tags('smoke'); this.tags('smoke');
before(async () => { before(async () => {
// init data // init data

View file

@ -41,8 +41,8 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.settings.navigateTo(); await PageObjects.settings.navigateTo();
}); });
describe('Security', async () => { describe('Security', () => {
describe('navigation', async () => { describe('navigation', () => {
it('Can navigate to create user section', async () => { it('Can navigate to create user section', async () => {
await PageObjects.security.clickElasticsearchUsers(); await PageObjects.security.clickElasticsearchUsers();
await PageObjects.security.clickCreateNewUser(); await PageObjects.security.clickCreateNewUser();

View file

@ -14,7 +14,7 @@ export default function ({ getService, getPageObjects }) {
const browser = getService('browser'); const browser = getService('browser');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
describe('rbac ', async function () { describe('rbac ', function () {
before(async () => { before(async () => {
await browser.setWindowSize(1600, 1000); await browser.setWindowSize(1600, 1000);
log.debug('users'); log.debug('users');

View file

@ -92,7 +92,7 @@ export default function spaceSelectorFunctonalTests({
await esArchiver.unload('spaces/selector'); await esArchiver.unload('spaces/selector');
}); });
describe('displays separate data for each space', async () => { describe('displays separate data for each space', () => {
it('in the default space', async () => { it('in the default space', async () => {
await PageObjects.common.navigateToApp('dashboard'); await PageObjects.common.navigateToApp('dashboard');
await expectDashboardRenders('[Logs] Web Traffic'); await expectDashboardRenders('[Logs] Web Traffic');

View file

@ -20,7 +20,7 @@ export default function ({ getService }) {
const reportingAPI = getService('reportingAPI'); const reportingAPI = getService('reportingAPI');
const usageAPI = getService('usageAPI'); const usageAPI = getService('usageAPI');
describe('BWC report generation into existing indexes', async () => { describe('BWC report generation into existing indexes', () => {
let expectedCompletedReportCount; let expectedCompletedReportCount;
let cleanupIndexAlias; let cleanupIndexAlias;

View file

@ -164,7 +164,7 @@ export function deleteTestSuiteFactory(es: any, esArchiver: any, supertest: Supe
.then(tests.exists.response); .then(tests.exists.response);
}); });
describe(`when the space is reserved`, async () => { describe(`when the space is reserved`, () => {
it(`should return ${tests.reservedSpace.statusCode}`, async () => { it(`should return ${tests.reservedSpace.statusCode}`, async () => {
return supertest return supertest
.delete(`${getUrlPrefix(spaceId)}/api/spaces/space/default`) .delete(`${getUrlPrefix(spaceId)}/api/spaces/space/default`)

View file

@ -7,7 +7,7 @@
import * as kbnTestServer from '../../../../src/test_utils/kbn_server'; import * as kbnTestServer from '../../../../src/test_utils/kbn_server';
import { TestKbnServerConfig } from '../../kbn_server_config'; import { TestKbnServerConfig } from '../../kbn_server_config';
describe('example integration test with kbn server', async () => { describe('example integration test with kbn server', () => {
let kbn: any; let kbn: any;
let kbnServer: any; let kbnServer: any;
let kbnRootServer: any; let kbnRootServer: any;