Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new global error treatment (client-side) #4163

Merged
merged 135 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from 133 commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
288f91c
Fixed catch error throw string instead error
Machi3mfl May 23, 2022
e2d1adc
Added ErrorFactory with tests
Machi3mfl May 24, 2022
df7869a
Implemented ErrorFactory on generic-request and tests
Machi3mfl May 24, 2022
284e566
Fixed tests
Machi3mfl May 24, 2022
ebcddf5
Refactored errorfactory for create differents error types
Machi3mfl May 25, 2022
f6159b4
Added prevent create new error when it is
Machi3mfl May 27, 2022
41b8fe8
Added error factory in wz-request
Machi3mfl May 27, 2022
0eac3e3
Added error factory in wz-api-check
Machi3mfl May 27, 2022
fbf476b
Added error factory in saved-objects and tests
Machi3mfl May 27, 2022
47e992a
Changed wz-api-check for typescript file
Machi3mfl May 27, 2022
5ff1b29
Refactoring error factory
Machi3mfl May 30, 2022
78efcf5
Fixed generic-request test
Machi3mfl May 30, 2022
118cdab
Added Settings Controller tests for onInit event
Machi3mfl May 31, 2022
a48331e
Edited ErrorFactory createError
Machi3mfl Jun 2, 2022
6af15eb
Added check api service tests
Machi3mfl Jun 2, 2022
7dfa4d3
Moved error factory files
Machi3mfl Jun 27, 2022
73dc89c
Added error-handler with new implementation
Machi3mfl Jul 4, 2022
d5e00a7
Fixed types and unit tests
Machi3mfl Feb 1, 2023
08e3024
Skiped some unit tests
Machi3mfl Feb 1, 2023
e49fe4a
Skiped react services unit tests
Machi3mfl Feb 1, 2023
60c2df9
Added unit test to return error in error handler
Machi3mfl Feb 3, 2023
2c49a89
Added new errors classes relantionship
Machi3mfl Feb 6, 2023
3a9d1f1
Resolved conflict
Machi3mfl Feb 10, 2023
690b095
Reordered folder structure
Machi3mfl Feb 14, 2023
5f54f44
Added error factory unit test for every error classes
Machi3mfl Feb 14, 2023
1b990c0
Added error handler unit tests
Machi3mfl Feb 14, 2023
69dd995
Fixed and skipped some errors
Machi3mfl Feb 14, 2023
1260fce
Updated hook and hoc unit tests
Machi3mfl Feb 14, 2023
e95bbe0
Restoring services state
Machi3mfl Feb 16, 2023
7bdcf66
Added README
Machi3mfl Feb 16, 2023
891bbc7
Fixed unit tests
Machi3mfl Feb 16, 2023
b6d3e42
Fixed check api service
Machi3mfl Feb 16, 2023
6b41131
Unit tests check api service
Machi3mfl Feb 16, 2023
f8beed9
Added unit tests for errorHandler HOC and updated README
Machi3mfl Feb 17, 2023
ef642d3
Updated handle error return error instance and unit tests
Machi3mfl Feb 17, 2023
e2b340e
Added logOptions in error classes, types and unit tests
Machi3mfl Feb 17, 2023
397df70
Fixed unit test useErrorHandler hook
Machi3mfl Feb 17, 2023
37a6035
Added WazuhError abstract class
Machi3mfl Feb 19, 2023
51d1d30
Added error handler decorator v1
Machi3mfl Feb 19, 2023
4492bee
Fixed generic request unit tests
Machi3mfl Feb 19, 2023
b7afae5
Fixed saved objects unit tests
Machi3mfl Feb 19, 2023
08012d4
Fixed wz api check unit tests
Machi3mfl Feb 19, 2023
46f8269
Removed wz request unit test
Machi3mfl Feb 22, 2023
9fd4b0a
Changed log error options
Machi3mfl Feb 22, 2023
08cc835
Cleaned decorator
Machi3mfl Feb 22, 2023
c86b5c7
Fixed decorator unit tests
Machi3mfl Feb 22, 2023
83ebbb1
Cleaned code decorator unit tests
Machi3mfl Feb 22, 2023
a3a5536
Modified error handler hook and fixed unit tests
Machi3mfl Feb 22, 2023
b502575
Added README content index
Machi3mfl Feb 22, 2023
2b7fac4
Fixed content links
Machi3mfl Feb 22, 2023
0a127d7
Updated README
Machi3mfl Feb 22, 2023
76f511f
Updated README with more error management details
Machi3mfl Feb 23, 2023
ccee226
Checking signed commit
Machi3mfl Feb 23, 2023
dfc565c
Checking which unit test throw error
Machi3mfl Feb 23, 2023
f63cc65
Fixed unit tests for Hook and Decorator
Machi3mfl Feb 23, 2023
05b2d33
Added error types treatment in README
Machi3mfl Feb 24, 2023
aff9940
Updated README
Machi3mfl Feb 24, 2023
e579f94
Renamed elastic to indexer
Machi3mfl Feb 27, 2023
28ff3d1
Added error display with custom title and message
Machi3mfl Mar 1, 2023
1ea5192
Added title and message customization for every error
Machi3mfl Mar 1, 2023
da096c5
Added error prompt in error handler HOC
Machi3mfl Mar 1, 2023
feafbda
Modified callback call in error handler hook
Machi3mfl Mar 1, 2023
7332a4c
Added new error categorization method with unit tests
Machi3mfl Mar 2, 2023
105a438
Adde docs folder and examples with unit tests
Machi3mfl Mar 2, 2023
7148ff0
Updated docs README
Machi3mfl Mar 3, 2023
b33fc40
Updated root README
Machi3mfl Mar 3, 2023
23fb1fe
Solved unit tests
Machi3mfl Mar 6, 2023
1b476e1
Added error handler uses cases examples docs
Machi3mfl Mar 6, 2023
cbcbffd
Updated README error treatment by types
Machi3mfl Mar 6, 2023
8274959
Updated Readme
Machi3mfl Mar 6, 2023
ac62963
Added title to log native javascript errors
Machi3mfl Mar 7, 2023
9a8d075
Modified console log error message structure
Machi3mfl Mar 7, 2023
1cb9d26
[Backport 4.5-2.3-wzd] Fix Changelog for WzD (#4893)
github-actions[bot] Nov 18, 2022
56f20bd
Init changelog 4.5.0
AlexRuiz7 Nov 18, 2022
01f7939
Bump to 4.5.0
AlexRuiz7 Nov 18, 2022
ae1bc62
Bump development Docker environments to 4.5.0 (#4896)
AlexRuiz7 Nov 18, 2022
dece8c5
Fix references to Elasticsearch in plugin for Wazuh stack (#4894)
chantal-kelm Nov 18, 2022
dcad7bf
[Backport 4.5] Typo correction (#4688) (#4913)
AlexRuiz7 Nov 21, 2022
b4c0091
[Backport 4.5] Fix IPV6 visualizations (#4920)
github-actions[bot] Nov 23, 2022
788222a
[Backport 4.5] 4711 error not caught and wrong error message in pci m…
chantal-kelm Nov 24, 2022
d9fa80c
Fix display of remote protocols when there are more than one (#4917) …
Tostti Nov 30, 2022
83dcae6
[Backport 4.5] Add endpoint response (#4995)
github-actions[bot] Dec 14, 2022
f7ff073
[Backport 4.5] Fix changelog (#5106)
github-actions[bot] Jan 11, 2023
2178376
Bump v4.4.0-2.4.1-rc1
AlexRuiz7 Jan 27, 2023
f4f9ed5
Create codeql.yml (#4987)
gdiazlo Dec 21, 2022
2b8259d
Create SECURITY.md
gdiazlo Dec 30, 2022
f7008ad
Update codeql.yml
AlexRuiz7 Dec 30, 2022
fc36221
Update codeql.yml
AlexRuiz7 Dec 30, 2022
0bbc60f
Create dependabot.yml
gdiazlo Jan 13, 2023
3094897
Update codeql.yml
gdiazlo Jan 13, 2023
eb9f253
Enable npm scan instead of yarn scan
gdiazlo Jan 13, 2023
1b4f1a8
Update dependabot.yml
AlexRuiz7 Jan 13, 2023
2bc99b8
Update dependabot.yml
gdiazlo Jan 20, 2023
4d69c58
Update codeql.yml
AlexRuiz7 Jan 20, 2023
547c4ca
Update codeql.yml
AlexRuiz7 Jan 20, 2023
54e5226
Update codeql.yml
AlexRuiz7 Jan 20, 2023
52572e1
Fix tests
AlexRuiz7 Feb 7, 2023
5c431ea
Fix imposter's response
AlexRuiz7 Feb 7, 2023
f50de84
Add ignore and restrict fields (#5203)
yenienserrano Feb 23, 2023
47f50dd
Change RexExp (#5201)
yenienserrano Feb 23, 2023
4a28d21
Add `rel="noopener noreferrer"` in documentation links (#5197)
yenienserrano Feb 23, 2023
55d60a4
Add development Docker image for OpenSearch 2.6.0
AlexRuiz7 Mar 7, 2023
5e5cb83
[Backport 4.5] Remove trailing `-` character for OS value in the list…
github-actions[bot] Mar 9, 2023
accb3b7
Bump angular-material from 1.1.18 to 1.2.5 (#5147)
dependabot[bot] Mar 9, 2023
bf4924f
Bump jwt-decode from 2.2.0 to 3.1.2 (#5148)
dependabot[bot] Mar 9, 2023
f86c29e
Bump markdown-it-link-attributes from 3.0.0 to 4.0.1 (#5149)
dependabot[bot] Mar 9, 2023
5d3c71d
Bump tslint from 5.20.1 to 6.1.3 (#5248)
dependabot[bot] Mar 9, 2023
d7efb41
Bump winston from 3.5.1 to 3.8.2 (#5249)
dependabot[bot] Mar 9, 2023
c1b11c3
Bump axios from 0.21.4 to 1.3.4 (#5230)
dependabot[bot] Mar 9, 2023
7c95bdd
Bump eslint-import-resolver-typescript from 2.7.1 to 3.5.3 (#5250)
dependabot[bot] Mar 9, 2023
0b9e744
Bump install from 0.10.4 to 0.13.0 (#5251)
dependabot[bot] Mar 9, 2023
10faf65
Bump needle from 2.9.1 to 3.2.0 (#5253)
dependabot[bot] Mar 9, 2023
787ad65
Bump angular-animate from 1.7.8 to 1.8.3 (#5257)
dependabot[bot] Mar 9, 2023
3e12360
Bump typescript-eslint-parser from 18.0.0 to 22.0.0 (#5255)
dependabot[bot] Mar 9, 2023
0e86f24
Bump eslint-plugin-filenames-simple from 0.7.0 to 0.8.0 (#5256)
dependabot[bot] Mar 9, 2023
726852b
Bump js2xmlparser from 3.0.0 to 5.0.0 (#5252)
dependabot[bot] Mar 9, 2023
95accb1
Fix jest config
AlexRuiz7 Mar 9, 2023
af1dffe
Bump platform version to 2.6.0
AlexRuiz7 Mar 9, 2023
d965c3a
[Backport 4.5] Fix cannot read null properties bug in settings sectio…
Desvelao Mar 9, 2023
00b0451
Revert "[Backport 4.5] Fix cannot read null properties bug in setting…
AlexRuiz7 Mar 9, 2023
11d18e5
[Backport 4.5] Fix cannot read null properties bug in settings sectio…
AlexRuiz7 Mar 9, 2023
cd8fc39
Add noopener noreferrer to externals links (#5274)
yenienserrano Mar 10, 2023
dfa1ff1
Fixed catch error throw string instead error
Machi3mfl May 23, 2022
b69e1e4
Added error factory in saved-objects and tests
Machi3mfl May 27, 2022
cc2ac8c
Restoring services state
Machi3mfl Feb 16, 2023
2bdc3f8
Merge branch '4.5' into feat/4145-request-errors-management
Machi3mfl Mar 10, 2023
3498ab8
Resolved conflict in check api service
Machi3mfl Mar 10, 2023
b6fdb40
Merge branch '4.5' into feat/4145-request-errors-management
Machi3mfl Apr 4, 2023
fda9ba6
Updated CHANGELOG
Machi3mfl Apr 4, 2023
4127629
Merge branch '4.5' into feat/4145-request-errors-management
Machi3mfl Apr 11, 2023
694bf1d
Fixed throw error when saved object index pattern not exists
Machi3mfl Apr 11, 2023
c5e75e1
Fix TypeError in FIM Inventory using new error handler (#5364)
Machi3mfl Apr 12, 2023
f36fb0a
Merge branch '4.5' into feat/4145-request-errors-management
Machi3mfl Apr 12, 2023
705e287
Resolved requested changes
Machi3mfl Apr 13, 2023
d54ee30
Updated CHANGELOG
Machi3mfl Apr 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to the Wazuh app project will be documented in this file.

- Added rel="noopener noreferrer" in documentation links. [#5197](https://github.com/wazuh/wazuh-kibana-app/pull/5197) [#5274](https://github.com/wazuh/wazuh-kibana-app/pull/5274) [#5298](https://github.com/wazuh/wazuh-kibana-app/pull/5298)
- Added `ignore` and `restrict` options to Syslog configuration. [#5203](https://github.com/wazuh/wazuh-kibana-app/pull/5203)
- Added new global error treatment (client-side) [#4163](https://github.com/wazuh/wazuh-kibana-app/pull/4163)

### Changed

Expand All @@ -22,6 +23,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Handling endpoint response was done when there is no data to show [#4918](https://github.com/wazuh/wazuh-kibana-app/pull/4918)
- Fixed references to Elasticsearch in Wazuh-stack plugin [4894](https://github.com/wazuh/wazuh-kibana-app/pull/4894)
- Fixed the 2 errors that appeared in console in Settings>Configuration section. [#5135](https://github.com/wazuh/wazuh-kibana-app/pull/5135)
- Fix TypeError in FIM Inventory using new error handler [#5364](https://github.com/wazuh/wazuh-kibana-app/pull/5364)

## Wazuh v4.4.1 - OpenSearch Dashboards 2.6.0 - Revision 01

Expand Down
40 changes: 23 additions & 17 deletions public/components/agents/fim/inventory/fileDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { getDataPlugin, getUiSettings } from '../../../../kibana-services';
import { RegistryValues } from './registryValues';
import { formatUIDate } from '../../../../react-services/time-service';
import { FilterManager } from '../../../../../../../src/plugins/data/public/';
import { ErrorHandler } from '../../../../react-services/error-management';

export class FileDetails extends Component {
props!: {
Expand Down Expand Up @@ -228,23 +229,28 @@ export class FileDetails extends Component {
}

async checkFilterManager(filters) {
const { filterManager } = getDataPlugin().query;
const _filters = filterManager.getFilters();
if (_filters && _filters.length) {
const syscheckPathFilters = _filters.filter((x) => {
return x.meta.key === 'syscheck.path';
});
syscheckPathFilters.map((x) => {
filterManager.removeFilter(x);
});
filterManager.addFilters([filters]);
const scope = await ModulesHelper.getDiscoverScope();
scope.updateQueryAndFetch({ query: null });
} else {
setTimeout(() => {
this.checkFilterManager(filters);
}, 200);
try {
const { filterManager } = getDataPlugin().query;
const _filters = filterManager.getFilters();
if (_filters && _filters.length) {
const syscheckPathFilters = _filters.filter((x) => {
return x.meta.key === 'syscheck.path';
});
syscheckPathFilters.map((x) => {
filterManager.removeFilter(x);
});
filterManager.addFilters([filters]);
const scope = await ModulesHelper.getDiscoverScope();
scope.updateQueryAndFetch && scope.updateQueryAndFetch({ query: null });
} else {
setTimeout(() => {
this.checkFilterManager(filters);
}, 200);
}
}catch(error){
ErrorHandler.handleError(error as Error);
}

}

addFilter(field, value) {
Expand Down Expand Up @@ -501,4 +507,4 @@ export class FileDetails extends Component {
</Fragment>
);
}
}
}
4 changes: 2 additions & 2 deletions public/components/agents/sca/inventory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -631,5 +631,5 @@ export class Inventory extends Component<InventoryProps, InventoryState> {
}

Inventory.defaultProps = {
onClickRow: undefined,
};
onClickRow: undefined
}
121 changes: 121 additions & 0 deletions public/components/health-check/services/check-api.service.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import * as service from './check-api.service';
import { CheckLogger } from '../types/check_logger';
import { ApiCheck, AppState } from '../../../react-services';
import axios, { AxiosResponse } from 'axios';

jest.mock('axios');
// app state
jest.mock('../../../react-services/app-state');
jest.mock('../../../kibana-services', () => ({
...(jest.requireActual('../../../kibana-services') as object),
getHttp: jest.fn().mockReturnValue({
basePath: {
get: () => {
return 'http://localhost:5601';
},
prepend: (url) => {
return `http://localhost:5601${url}`;
},
},
}),
getCookies: jest.fn().mockReturnValue({
set: (name, value, options) => {
return true;
},
get: () => {
return '{}';
},
remove: () => {
return;
},
}),
}));

const hostData = {
id: 'api',
url: 'url-mocked',
port: 9000,
username: 'username',
password: 'password',
run_as: false,
};
const getApiHostsResponse: AxiosResponse = {
data: [hostData],
status: 200,
statusText: 'OK',
headers: {},
config: {},
request: {},
};

const checkStoredErrorResponse: AxiosResponse = {
data: {
statusCode: 500,
error: 'Internal Server Error',
message: '3099 - ERROR3099 - Wazuh not ready yet',
},
status: 500,
statusText: 'Internal Server Error',
headers: {},
config: {},
request: {},
};

// checkLogger mocked
const checkLoggerMocked: CheckLogger = {
info: jest.fn(),
error: jest.fn(),
action: jest.fn(),
};

describe.skip('CheckApi Service', () => {
it('Should show logs info when api check pass successfully and have cluster_info ', async () => {
const currentApi = { id: 'api-mocked' };
AppState.getCurrentAPI = jest.fn().mockReturnValue(JSON.stringify(currentApi));
AppState.setClusterInfo = jest.fn();
const checkStoredResponse = {
data: {
data: {
url: 'url-mocked',
port: 9000,
username: 'username',
password: 'password',
run_as: false,
cluster_info: {
status: 'enabled',
node: 'master',
manager: 'manager-mocked',
cluster: 'cluster-mocked',
},
},
},
};
ApiCheck.checkStored = jest.fn().mockResolvedValue(Promise.resolve(checkStoredResponse));
await service.checkApiService({})(checkLoggerMocked);
expect(checkLoggerMocked.info).toBeCalledWith(`Current API id [${currentApi.id}]`);
expect(checkLoggerMocked.info).toBeCalledWith(`Checking current API id [${currentApi.id}]...`);
expect(checkLoggerMocked.info).toBeCalledWith(`Set cluster info in cookie`);
expect(checkLoggerMocked.info).toBeCalledTimes(3);
});

it('Should return ERROR and show logs info when api check fails on checkApi', async () => {
const currentApi = { id: 'api-mocked' };
AppState.getCurrentAPI = jest.fn().mockReturnValue(JSON.stringify(currentApi));
AppState.setClusterInfo = jest.fn();
ApiCheck.checkStored = jest.fn().mockResolvedValue(Promise.reject(checkStoredErrorResponse));
(axios as jest.MockedFunction<typeof axios>).mockResolvedValue(
Promise.resolve(getApiHostsResponse)
);

ApiCheck.checkApi = jest.fn().mockResolvedValue(Promise.reject(checkStoredErrorResponse));

try {
await service.checkApiService({})(checkLoggerMocked);
} catch (error) {
expect(error).toBeDefined();
expect(typeof error).not.toBe('string');
expect(error.message).toContain('No API available to connect');
expect(error).toBeInstanceOf(Error);
}
});
});
6 changes: 3 additions & 3 deletions public/components/health-check/services/check-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ const trySetDefault = async (checkLogger: CheckLogger) => {
);
}
}
return Promise.reject('No API available to connect');
return Promise.reject(new Error('No API available to connect'));
}
}
return Promise.reject('No API configuration found');
return Promise.reject(new Error('No API configuration found'));
} catch (error) {
checkLogger.error(`Error connecting to API: ${error}`);
return Promise.reject(`Error connecting to API: ${error}`);
return Promise.reject(new Error(`Error connecting to API: ${error}`));
}
};

Expand Down
12 changes: 8 additions & 4 deletions public/controllers/agent/components/agents-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ export const AgentsTable = withErrorBoundary(
field: 'id',
name: 'ID',
sortable: true,
show: true,
width: '4%',
Machi3mfl marked this conversation as resolved.
Show resolved Hide resolved
},
{
field: 'name',
Expand All @@ -469,13 +469,17 @@ export const AgentsTable = withErrorBoundary(
},
{
field: 'ip',
name: 'IP address',
name: 'IP',
width: '14%',
truncateText: true,
sortable: true,
show: true,
},
{
field: 'group',
name: 'Group(s)',
width: '12%',
truncateText: true,
sortable: true,
show: true,
render: (groups) => (groups !== '-' ? this.renderGroups(groups) : '-'),
Expand Down Expand Up @@ -516,14 +520,14 @@ export const AgentsTable = withErrorBoundary(
name: 'Status',
truncateText: true,
sortable: true,
show: true,
width: '8%',
render: (status) => <AgentStatus status={status} labelProps={{ className: 'hide-agent-status' }} />,
},
{
field: 'group_config_status',
name: 'Synced',
sortable: true,
show: false,
width: '10%',
render: (synced) => <AgentSynced synced={synced} />,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,47 @@ import { Provider } from 'react-redux';
import configureMockStore from 'redux-mock-store';

jest.mock('../../../../../../kibana-services', () => ({
getUiSettings:() => ({
get:() => {
return false
}
}),
getAngularModule: jest.fn(),
getUiSettings: () => ({
get: () => {
return false;
},
}),
}));

const mockProps = {
"clusterNodeSelected":"master-node",
"agent":{
"id":"000"
clusterNodeSelected: 'master-node',
agent: {
id: '000',
},
refreshTime: false,
currentConfig: {
'analysis-alerts': {
alerts: {
email_alert_level: 12,
log_alert_level: 3,
},
},
"refreshTime":false,
"currentConfig":{
"analysis-alerts":{
"alerts":{
"email_alert_level":12,
"log_alert_level":3
}
},
"analysis-labels":{
"labels":[

]
},
"mail-alerts":"Fetch configuration. 3013 - Error connecting with socket",
"monitor-reports":{

},
"csyslog-csyslog":"Fetch configuration. 3013 - Error connecting with socket"
'analysis-labels': {
labels: [],
},
"wazuhNotReadyYet":""
}

'mail-alerts': 'Fetch configuration. 3013 - Error connecting with socket',
'monitor-reports': {},
'csyslog-csyslog': 'Fetch configuration. 3013 - Error connecting with socket',
},
wazuhNotReadyYet: '',
};

const mockStore = configureMockStore();
const store = mockStore({});

describe('WzConfigurationAlerts component mount OK', () => {

it('renders correctly to match the snapshot', () => {
const wrapper = shallow(
<Provider store={store}>
<WzConfigurationAlerts {...mockProps} />
</Provider>
);
<Provider store={store}>
<WzConfigurationAlerts {...mockProps} />
</Provider>
);
expect(wrapper).toMatchSnapshot();
});

});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ import { Provider } from 'react-redux';
import configureMockStore from 'redux-mock-store';

jest.mock('../../../../../../kibana-services', () => ({
getAngularModule: jest.fn(),
getUiSettings: () => ({
get: (uiSetting: string) => {
if (uiSetting === 'theme:darkMode') {
return false
return false;
}
}
})
},
}),
}));

const mockStore = configureMockStore();
Expand Down
Loading