Skip to content

Commit

Permalink
test: fix of check updates plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Desvelao committed Dec 5, 2023
1 parent 54187b5 commit efc99e2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,42 +93,6 @@ describe('getUpdates function', () => {
});

test('should return available updates from api', async () => {
mockedGetWazuhCore.mockImplementation(() => ({
controllers: {
WazuhHostsCtrl: jest.fn().mockImplementation(() => ({
getHostsEntries: jest
.fn()
.mockImplementation(() => [{ id: 'api id' }]),
})),
},
services: {
wazuhApiClient: {
client: {
asInternalUser: {
request: jest.fn().mockImplementation(() => ({
data: {
data: {
current_version: '4.3.1',
last_available_patch: {
description:
'## Manager\r\n\r\n### Fixed\r\n\r\n- Fixed a crash when overwrite rules are triggered...',
published_date: '2022-05-18T10:12:43Z',
semver: {
major: 4,
minor: 3,
patch: 8,
},
tag: 'v4.3.8',
title: 'Wazuh v4.3.8',
},
},
},
})),
},
},
},
},
}));
mockedSetSavedObject.mockImplementation(() => ({}));
mockedGetWazuhCore.mockImplementation(() => ({
api: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ describe('getUserPreferences function', () => {
test('should return an error', async () => {
mockedGetSavedObject.mockRejectedValue(new Error('getSavedObject error'));

mockedGetWazuhCore.mockImplementation(() => ({
services: { log: jest.fn().mockImplementation(() => {}) },
}));

const promise = getUserPreferences('admin');

expect(getSavedObject).toHaveBeenCalledTimes(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ describe('updateUserPreferences function', () => {
test('should return an error', async () => {
mockedSetSavedObject.mockRejectedValue(new Error('getSavedObject error'));

mockedGetWazuhCore.mockImplementation(() => ({
services: { log: jest.fn().mockImplementation(() => {}) },
}));

const promise = updateUserPreferences('admin', {
last_dismissed_updates: [
{
Expand Down

0 comments on commit efc99e2

Please sign in to comment.