Skip to content

Commit

Permalink
Update useDevices mock in accordance with composable updates
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellamaki committed Sep 28, 2023
1 parent 6f2315a commit c654e88
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@
* ```
*/

import { ref } from 'kolibri.lib.vueCompositionApi';

const MOCK_DEFAULTS = {
fetchDevices: jest.fn(() => Promise.resolve([])),
baseurl: null,
networkDevices: ref({}),
};

export function useDevicesMock(overrides = {}) {
Expand All @@ -43,6 +46,14 @@ export function useDevicesMock(overrides = {}) {
};
}

const DEVICE_DATA_DEFAULTS = {
baseurl: 'http://test-device',
deviceName: 'test-device',
instanceId: '1234',
};

export const currentDeviceData = jest.fn(() => DEVICE_DATA_DEFAULTS);

export default jest.fn(() => useDevicesMock());

export const setCurrentDevice = jest.fn(id =>
Expand Down

0 comments on commit c654e88

Please sign in to comment.