mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
# Backport This will backport the following commits from `main` to `7.17`: - [Bump jest@29.6.1 (#161630)](https://github.com/elastic/kibana/pull/161630) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Patryk Kopyciński","email":"contact@patrykkopycinski.com"},"sourceCommit":{"committedDate":"2023-07-15T15:42:30Z","message":"Bump jest@29.6.1 (#161630)\n\n## Summary\r\n\r\nBump `jest@29.6.1` and resolve duplicated jest-related dependencies\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"b2b7cf6253252be011198feda6f04d892cfc5515","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:uptime","release_note:skip","backport:prev-MAJOR","v8.9.0","v8.10.0"],"number":161630,"url":"https://github.com/elastic/kibana/pull/161630","mergeCommit":{"message":"Bump jest@29.6.1 (#161630)\n\n## Summary\r\n\r\nBump `jest@29.6.1` and resolve duplicated jest-related dependencies\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"b2b7cf6253252be011198feda6f04d892cfc5515"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"8.9","label":"v8.9.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/162008","number":162008,"state":"MERGED","mergeCommit":{"sha":"d3e1266850f2a6f03ce2fbe05a4732218d11e1f8","message":"[8.9] Bump jest@29.6.1 (#161630) (#162008)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.9`:\n- [Bump jest@29.6.1\n(#161630)](https://github.com/elastic/kibana/pull/161630)\n\n<!--- Backport version: 8.9.7 -->\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT [{\"author\":{\"name\":\"Patryk\nKopyciński\",\"email\":\"contact@patrykkopycinski.com\"},\"sourceCommit\":{\"committedDate\":\"2023-07-15T15:42:30Z\",\"message\":\"Bump\njest@29.6.1 (#161630)\\n\\n## Summary\\r\\n\\r\\nBump `jest@29.6.1` and\nresolve duplicated jest-related\ndependencies\\r\\n\\r\\n---------\\r\\n\\r\\nCo-authored-by: kibanamachine\n<42973632+kibanamachine@users.noreply.github.com>\",\"sha\":\"b2b7cf6253252be011198feda6f04d892cfc5515\",\"branchLabelMapping\":{\"^v8.10.0$\":\"main\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"Team:uptime\",\"release_note:skip\",\"backport:prev-MAJOR\",\"v8.10.0\"],\"number\":161630,\"url\":\"https://github.com/elastic/kibana/pull/161630\",\"mergeCommit\":{\"message\":\"Bump\njest@29.6.1 (#161630)\\n\\n## Summary\\r\\n\\r\\nBump `jest@29.6.1` and\nresolve duplicated jest-related\ndependencies\\r\\n\\r\\n---------\\r\\n\\r\\nCo-authored-by: kibanamachine\n<42973632+kibanamachine@users.noreply.github.com>\",\"sha\":\"b2b7cf6253252be011198feda6f04d892cfc5515\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v8.10.0\",\"labelRegex\":\"^v8.10.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/161630\",\"number\":161630,\"mergeCommit\":{\"message\":\"Bump\njest@29.6.1 (#161630)\\n\\n## Summary\\r\\n\\r\\nBump `jest@29.6.1` and\nresolve duplicated jest-related\ndependencies\\r\\n\\r\\n---------\\r\\n\\r\\nCo-authored-by: kibanamachine\n<42973632+kibanamachine@users.noreply.github.com>\",\"sha\":\"b2b7cf6253252be011198feda6f04d892cfc5515\"}}]}]\nBACKPORT-->\n\nCo-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>"}},{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/161630","number":161630,"mergeCommit":{"message":"Bump jest@29.6.1 (#161630)\n\n## Summary\r\n\r\nBump `jest@29.6.1` and resolve duplicated jest-related dependencies\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"b2b7cf6253252be011198feda6f04d892cfc5515"}}]}] BACKPORT-->
This commit is contained in:
parent
3545ce4531
commit
376c1cd835
48 changed files with 646 additions and 895 deletions
59
package.json
59
package.json
|
@ -75,28 +75,14 @@
|
|||
"**/@babel/runtime": "^7.21.0",
|
||||
"**/@babel/traverse": "^7.21.2",
|
||||
"**/@babel/types": "^7.21.2",
|
||||
"**/@jest/console": "29.3.1",
|
||||
"**/@jest/reporters": "29.3.1",
|
||||
"**/@types/babel__generator/@babel/types": "^7.21.0",
|
||||
"**/@types/node": "16.11.7",
|
||||
"**/@types/react-dom": "^16.9.8",
|
||||
"**/babel-jest": "29.3.1",
|
||||
"**/chokidar": "^3.4.3",
|
||||
"**/expect": "29.3.1",
|
||||
"**/globule/minimatch": "^3.1.2",
|
||||
"**/hoist-non-react-statics": "^3.3.2",
|
||||
"**/html-minifier/uglify-js": "^3.14.3",
|
||||
"**/isomorphic-fetch/node-fetch": "^2.6.7",
|
||||
"**/istanbul-instrumenter-loader/schema-utils": "1.0.0",
|
||||
"**/jest": "29.3.1",
|
||||
"**/jest-cli": "29.3.1",
|
||||
"**/jest-config": "29.3.1",
|
||||
"**/jest-diff": "29.3.1",
|
||||
"**/jest-environment-jsdom": "29.3.1",
|
||||
"**/jest-matcher-utils": "29.3.1",
|
||||
"**/jest-mock": "29.3.1",
|
||||
"**/jest-runtime": "29.3.1",
|
||||
"**/jest-snapshot": "29.3.1",
|
||||
"**/json-schema": "^0.4.0",
|
||||
"**/pdfkit/crypto-js": "4.0.0",
|
||||
"**/react-syntax-highlighter": "^15.3.1",
|
||||
|
@ -461,9 +447,10 @@
|
|||
"@emotion/babel-preset-css-prop": "^11.11.0",
|
||||
"@emotion/jest": "^11.3.0",
|
||||
"@istanbuljs/schema": "^0.1.2",
|
||||
"@jest/console": "29.3.1",
|
||||
"@jest/reporters": "29.3.1",
|
||||
"@jest/types": "29.3.1",
|
||||
"@jest/console": "^29.6.1",
|
||||
"@jest/reporters": "^29.6.1",
|
||||
"@jest/transform": "^29.6.1",
|
||||
"@jest/types": "^29.6.1",
|
||||
"@kbn/babel-code-parser": "link:bazel-bin/packages/kbn-babel-code-parser",
|
||||
"@kbn/babel-preset": "link:bazel-bin/packages/kbn-babel-preset",
|
||||
"@kbn/babel-register": "link:bazel-bin/packages/kbn-babel-register",
|
||||
|
@ -568,13 +555,12 @@
|
|||
"@types/http-proxy": "^1.17.4",
|
||||
"@types/inquirer": "^7.3.1",
|
||||
"@types/intl-relativeformat": "^2.1.0",
|
||||
"@types/jest": "29.2.0",
|
||||
"@types/jest-specific-snapshot": "^0.5.5",
|
||||
"@types/jest": "^29.5.3",
|
||||
"@types/jest-when": "^2.7.2",
|
||||
"@types/jquery": "^3.3.31",
|
||||
"@types/js-search": "^1.4.0",
|
||||
"@types/js-yaml": "^3.11.1",
|
||||
"@types/jsdom": "^16.2.13",
|
||||
"@types/jsdom": "^20.0.1",
|
||||
"@types/json-stable-stringify": "^1.0.32",
|
||||
"@types/json5": "^2.2.0",
|
||||
"@types/license-checker": "15.0.0",
|
||||
|
@ -675,7 +661,7 @@
|
|||
"argsplit": "^1.0.5",
|
||||
"autoprefixer": "^10.4.7",
|
||||
"axe-core": "^4.0.2",
|
||||
"babel-jest": "29.3.1",
|
||||
"babel-jest": "^29.6.1",
|
||||
"babel-loader": "^8.2.5",
|
||||
"babel-plugin-add-module-exports": "^1.0.4",
|
||||
"babel-plugin-istanbul": "^6.1.1",
|
||||
|
@ -756,23 +742,20 @@
|
|||
"inquirer": "^7.3.3",
|
||||
"is-glob": "^4.0.1",
|
||||
"is-path-inside": "^3.0.2",
|
||||
"istanbul-instrumenter-loader": "^3.0.1",
|
||||
"jest": "29.3.1",
|
||||
"jest-canvas-mock": "^2.3.1",
|
||||
"jest-cli": "29.3.1",
|
||||
"jest-config": "29.3.1",
|
||||
"jest-diff": "29.3.1",
|
||||
"jest-environment-jsdom": "29.3.1",
|
||||
"jest-environment-jsdom-thirteen": "^1.0.1",
|
||||
"jest-matcher-utils": "29.3.1",
|
||||
"jest-mock": "29.3.1",
|
||||
"jest-runtime": "29.3.1",
|
||||
"jest-silent-reporter": "^0.5.0",
|
||||
"jest-snapshot": "29.3.1",
|
||||
"jest-specific-snapshot": "^5.0.0",
|
||||
"jest": "^29.6.1",
|
||||
"jest-canvas-mock": "^2.5.2",
|
||||
"jest-cli": "^29.6.1",
|
||||
"jest-config": "^29.6.1",
|
||||
"jest-diff": "^29.6.1",
|
||||
"jest-environment-jsdom": "^29.6.1",
|
||||
"jest-matcher-utils": "^29.6.1",
|
||||
"jest-mock": "^29.6.1",
|
||||
"jest-runtime": "^29.6.1",
|
||||
"jest-snapshot": "^29.6.1",
|
||||
"jest-specific-snapshot": "^8.0.0",
|
||||
"jest-styled-components": "7.0.3",
|
||||
"jest-when": "3.4.1",
|
||||
"jsdom": "13.1.0",
|
||||
"jest-when": "^3.5.2",
|
||||
"jsdom": "^20.0.1",
|
||||
"json-schema-typed": "^8.0.1",
|
||||
"json5": "^2.2.3",
|
||||
"jsondiffpatch": "0.4.1",
|
||||
|
@ -808,7 +791,7 @@
|
|||
"postcss-loader": "^4.2.0",
|
||||
"postcss-prefix-selector": "^1.16.0",
|
||||
"prettier": "^2.7.1",
|
||||
"pretty-format": "29.3.1",
|
||||
"pretty-format": "^29.6.1",
|
||||
"pretty-ms": "^5.0.0",
|
||||
"proxy": "^2.1.1",
|
||||
"q": "^1.5.1",
|
||||
|
|
|
@ -1140,7 +1140,7 @@ describe('#stop()', () => {
|
|||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
it('removes the beforeunload listener', async () => {
|
||||
|
|
|
@ -36,7 +36,7 @@ beforeEach(() => {
|
|||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
mockCreateWriteStream.mockClear();
|
||||
mockStreamWrite.mockClear();
|
||||
});
|
||||
|
|
|
@ -23,7 +23,7 @@ describe('OsMetricsCollector', () => {
|
|||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
it('collects platform info from the os package', async () => {
|
||||
|
|
|
@ -179,7 +179,7 @@ describe('plugins discovery system', () => {
|
|||
afterEach(() => {
|
||||
mockFs.restore();
|
||||
// restore the console.log behavior
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
it('discovers plugins in the search locations', async () => {
|
||||
|
|
|
@ -28,7 +28,7 @@ beforeEach(() => {
|
|||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
logger.asLoggerFactory.mockClear();
|
||||
logger.stop.mockClear();
|
||||
rawConfigService.getConfig$.mockClear();
|
||||
|
|
|
@ -48,7 +48,7 @@ describe('AggConfig', () => {
|
|||
];
|
||||
|
||||
beforeEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
indexPattern = {
|
||||
id: '1234',
|
||||
title: 'logstash-*',
|
||||
|
@ -231,6 +231,7 @@ describe('AggConfig', () => {
|
|||
objs.forEach((obj, i) => {
|
||||
expect(obj).toHaveProperty('id', String(start + i));
|
||||
});
|
||||
spy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ let ruleTypeRegistryParams: ConstructorOptions;
|
|||
const taskManager = taskManagerMock.createSetup();
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.clearAllMocks();
|
||||
mockedLicenseState = licenseStateMock.create();
|
||||
ruleTypeRegistryParams = {
|
||||
taskManager,
|
||||
|
@ -76,16 +76,18 @@ describe('register()', () => {
|
|||
|
||||
const invalidCharacters = [' ', ':', '*', '*', '/'];
|
||||
for (const char of invalidCharacters) {
|
||||
expect(() => registry.register({ ...alertType, id: `${alertType.id}${char}` })).toThrowError(
|
||||
new Error(`expected AlertType Id not to include invalid character: ${char}`)
|
||||
expect(() =>
|
||||
registry.register({ ...alertType, id: `${alertType.id}${char}` })
|
||||
).toThrowErrorMatchingInlineSnapshot(
|
||||
`"expected AlertType Id not to include invalid character: ${char}"`
|
||||
);
|
||||
}
|
||||
|
||||
const [first, second] = invalidCharacters;
|
||||
expect(() =>
|
||||
registry.register({ ...alertType, id: `${first}${alertType.id}${second}` })
|
||||
).toThrowError(
|
||||
new Error(`expected AlertType Id not to include invalid characters: ${first}, ${second}`)
|
||||
).toThrowErrorMatchingInlineSnapshot(
|
||||
`"expected AlertType Id not to include invalid characters: ${first}, ${second}"`
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -107,8 +109,8 @@ describe('register()', () => {
|
|||
};
|
||||
const registry = new RuleTypeRegistry(ruleTypeRegistryParams);
|
||||
|
||||
expect(() => registry.register(alertType)).toThrowError(
|
||||
new Error(`expected value of type [string] but got [number]`)
|
||||
expect(() => registry.register(alertType)).toThrowErrorMatchingInlineSnapshot(
|
||||
`"expected value of type [string] but got [number]"`
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -184,9 +184,9 @@ describe('TimeComparison', () => {
|
|||
});
|
||||
|
||||
describe('TimeComparison component', () => {
|
||||
const spy = jest.spyOn(urlHelpers, 'replace');
|
||||
const spy = jest.spyOn(urlHelpers, 'replace').mockImplementation(() => {});
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
spy.mockClear();
|
||||
});
|
||||
describe('Time range is between 0 - 24 hours', () => {
|
||||
it('sets default values', () => {
|
||||
|
|
|
@ -16,7 +16,6 @@ jest.mock('../../common/lib/kibana');
|
|||
describe('useActionTypes', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
test('init', async () => {
|
||||
|
|
|
@ -46,7 +46,6 @@ const configuration: ConnectorConfiguration = {
|
|||
describe('useConfigure', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
test('init', async () => {
|
||||
|
|
|
@ -16,7 +16,6 @@ jest.mock('../../common/lib/kibana');
|
|||
describe('useConnectors', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
test('init', async () => {
|
||||
|
|
|
@ -18,7 +18,6 @@ describe('useUpdateCases', () => {
|
|||
const abortCtrl = new AbortController();
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
|
@ -17,7 +17,6 @@ describe('useGetActionLicense', () => {
|
|||
const abortCtrl = new AbortController();
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
|
@ -17,7 +17,6 @@ describe('useGetCase', () => {
|
|||
const abortCtrl = new AbortController();
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
|
@ -31,7 +31,6 @@ describe('useGetCaseUserActions', () => {
|
|||
const abortCtrl = new AbortController();
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
|
@ -27,7 +27,6 @@ describe('useGetCases', () => {
|
|||
const abortCtrl = new AbortController();
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
|
@ -20,7 +20,6 @@ describe('useGetCasesStatus', () => {
|
|||
const abortCtrl = new AbortController();
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
|
@ -20,7 +20,6 @@ describe('useGetReporters', () => {
|
|||
const abortCtrl = new AbortController();
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
|
@ -20,7 +20,6 @@ describe('useGetTags', () => {
|
|||
const abortCtrl = new AbortController();
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
|
@ -33,7 +33,6 @@ describe('usePostCase', () => {
|
|||
};
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
|
@ -25,7 +25,6 @@ describe('usePostComment', () => {
|
|||
const updateCaseCallback = jest.fn();
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
|
@ -33,7 +33,6 @@ describe('useUpdateCase', () => {
|
|||
};
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
|
@ -36,7 +36,6 @@ describe('useUpdateComment', () => {
|
|||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
|
@ -840,10 +840,12 @@ services.alertInstanceFactory.mockImplementation((instanceID: string) => {
|
|||
alertInstance.state = newState;
|
||||
return alertInstance.instance;
|
||||
});
|
||||
alertInstance.instance.scheduleActions.mockImplementation((id: string, action: any) => {
|
||||
alertInstance.actionQueue.push({ id, action });
|
||||
return alertInstance.instance;
|
||||
});
|
||||
(alertInstance.instance.scheduleActions as jest.Mock).mockImplementation(
|
||||
(id: string, action: any) => {
|
||||
alertInstance.actionQueue.push({ id, action });
|
||||
return alertInstance.instance;
|
||||
}
|
||||
);
|
||||
return alertInstance.instance;
|
||||
});
|
||||
|
||||
|
|
|
@ -69,7 +69,6 @@ describe('getElementPositionAndAttributes', () => {
|
|||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
document.body.innerHTML = '';
|
||||
});
|
||||
|
||||
|
|
|
@ -85,7 +85,6 @@ describe('POST /diagnose/browser', () => {
|
|||
});
|
||||
|
||||
afterEach(async () => {
|
||||
jest.restoreAllMocks();
|
||||
await server.stop();
|
||||
});
|
||||
|
||||
|
|
|
@ -101,7 +101,6 @@ describe('When the add exception modal is opened', () => {
|
|||
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
describe('when the modal is loading', () => {
|
||||
|
|
|
@ -104,7 +104,6 @@ describe('When the edit exception modal is opened', () => {
|
|||
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
describe('when the modal is loading', () => {
|
||||
|
|
|
@ -149,7 +149,6 @@ describe('useAddOrUpdateException', () => {
|
|||
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('initializes hook', async () => {
|
||||
|
|
|
@ -108,7 +108,6 @@ describe.skip('useFetchOrCreateRuleExceptionList', () => {
|
|||
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('initializes hook', async () => {
|
||||
|
|
|
@ -51,7 +51,6 @@ const defaultProps = {
|
|||
describe('Sourcerer component', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
const state: State = mockGlobalState;
|
||||
const { storage } = createSecuritySolutionStorageMock();
|
||||
|
|
|
@ -112,7 +112,6 @@ describe('Sourcerer Hooks', () => {
|
|||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
store = createStore(state, SUB_PLUGINS_REDUCER, kibanaObservable, storage);
|
||||
mockUseUserInfo.mockImplementation(() => userInfoState);
|
||||
});
|
||||
|
|
|
@ -80,7 +80,6 @@ describe('AlertsHistogramPanel', () => {
|
|||
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('renders correctly', () => {
|
||||
|
@ -148,6 +147,7 @@ describe('AlertsHistogramPanel', () => {
|
|||
expect(wrapper.find('[data-test-subj="alerts-histogram-panel"]').exists()).toBeTruthy();
|
||||
});
|
||||
wrapper.unmount();
|
||||
spyOnBuildEsQuery.mockRestore();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -186,6 +186,7 @@ describe('AlertsHistogramPanel', () => {
|
|||
]);
|
||||
});
|
||||
wrapper.unmount();
|
||||
mockGetAlertsHistogramQuery.mockReset();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ describe('alert actions', () => {
|
|||
// spyOn. So now we're doing all three of these.
|
||||
// https://github.com/facebook/jest/issues/7136#issuecomment-565976599
|
||||
jest.resetAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
|
||||
createTimeline = jest.fn() as jest.Mocked<CreateTimeline>;
|
||||
|
|
|
@ -22,9 +22,6 @@ describe('useCasesFromAlerts hook', () => {
|
|||
appToastsMock = useAppToastsMock.create();
|
||||
(useAppToasts as jest.Mock).mockReturnValue(appToastsMock);
|
||||
});
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('returns an array of caseIds', async () => {
|
||||
const spyOnCases = jest.spyOn(api, 'getCaseIdsFromAlertId');
|
||||
|
|
|
@ -28,7 +28,7 @@ jest.mock('./api', () => ({
|
|||
|
||||
describe('usePrePackagedRules', () => {
|
||||
beforeEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
test('init', async () => {
|
||||
|
|
|
@ -80,10 +80,11 @@ describe('pick_events', () => {
|
|||
beforeAll(() => {
|
||||
(EuiToolTip as unknown as jest.Mock).mockImplementation(mockTooltip);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('renders', () => {
|
||||
const wrapper = render(
|
||||
<TestProviders>
|
||||
|
|
|
@ -31,7 +31,6 @@ describe.each([
|
|||
])('read_rules - %s', (_, isRuleRegistryEnabled) => {
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
describe('readRules', () => {
|
||||
|
|
|
@ -83,7 +83,6 @@ describe('utils', () => {
|
|||
clock.restore();
|
||||
jest.clearAllMocks();
|
||||
jest.resetAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
describe('generateId', () => {
|
||||
|
|
|
@ -35,7 +35,6 @@ describe('clean draft timelines', () => {
|
|||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
jest.resetAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
|
||||
server = serverMock.create();
|
||||
|
|
|
@ -34,7 +34,6 @@ describe('get draft timelines', () => {
|
|||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
jest.resetAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
|
||||
server = serverMock.create();
|
||||
|
|
|
@ -45,7 +45,6 @@ describe('create timelines', () => {
|
|||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
jest.resetAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
|
||||
server = serverMock.create();
|
||||
|
|
|
@ -53,7 +53,6 @@ describe('import timelines', () => {
|
|||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
jest.resetAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
|
||||
server = serverMock.create();
|
||||
|
@ -501,7 +500,6 @@ describe('import timeline templates', () => {
|
|||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
jest.resetAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
|
||||
server = serverMock.create();
|
||||
|
|
|
@ -42,7 +42,6 @@ describe('update timelines', () => {
|
|||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
jest.resetAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
|
||||
server = serverMock.create();
|
||||
|
|
|
@ -26,7 +26,7 @@ const alertInstanceFactory =
|
|||
GeoContainmentInstanceState,
|
||||
GeoContainmentInstanceContext
|
||||
>();
|
||||
alertInstance.scheduleActions.mockImplementation(
|
||||
(alertInstance.scheduleActions as jest.Mock).mockImplementation(
|
||||
(actionGroupId: string, context?: GeoContainmentInstanceContext) => {
|
||||
// Check subset of alert for comparison to expected results
|
||||
// @ts-ignore
|
||||
|
|
|
@ -40,7 +40,6 @@ describe('useGetApplication', () => {
|
|||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('init', async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue