From c654e88c43941140466b426a1de2ccb597cb9434 Mon Sep 17 00:00:00 2001 From: Marcella Maki Date: Thu, 28 Sep 2023 16:02:41 -0400 Subject: [PATCH] Update useDevices mock in accordance with composable updates --- .../assets/src/composables/__mocks__/useDevices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kolibri/plugins/learn/assets/src/composables/__mocks__/useDevices.js b/kolibri/plugins/learn/assets/src/composables/__mocks__/useDevices.js index a8fdb132d50..aaadc15de4d 100644 --- a/kolibri/plugins/learn/assets/src/composables/__mocks__/useDevices.js +++ b/kolibri/plugins/learn/assets/src/composables/__mocks__/useDevices.js @@ -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 = {}) { @@ -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 =>