diff --git a/applications/launchpad_v2/__tests__/mocks/mockTauriIPC.ts b/applications/launchpad_v2/__tests__/mocks/mockTauriIPC.ts index 3c178d3079..4f222904ea 100644 --- a/applications/launchpad_v2/__tests__/mocks/mockTauriIPC.ts +++ b/applications/launchpad_v2/__tests__/mocks/mockTauriIPC.ts @@ -8,21 +8,21 @@ export const defaultTauriMockValues: Record = { arch: 'x86_64', platform: 'darwin', ostype: 'Darwin', - } + }, } /** * The Tauri IPC mock. - * + * * It uses Tauri's mockIPC and returns the value set in the `props`. * If nothing found in `props`, it will return a value from from `defaultTauriMockValues`. - * + * * @param {Record} props - pass the value you expect in tests - * + * * @example * // Use default values: * tauriIPCMock() - * + * * // Get given value from specific API module (ie. 'platform' from 'os' module) * tauriIPCMock({ * os: { @@ -43,14 +43,25 @@ export const tauriIPCMock = (props: Record = undefined) => { }) } -const tauriCmdMock = (cmd: string, args: Record, props: Record) => { +const tauriCmdMock = ( + cmd: string, + args: Record, + props: Record, +) => { const tauriModule = (args?.__tauriModule as string)?.toLowerCase() const messageCmd = (args?.message as { cmd?: string })?.cmd?.toLowerCase() if (tauriModule && messageCmd) { - if (props && Object.keys(props).includes(tauriModule) && Object.keys(props[tauriModule ]).includes(messageCmd)) { - return props[tauriModule][messageCmd ] - } else if (Object.keys(defaultTauriMockValues).includes(tauriModule) && Object.keys(defaultTauriMockValues[tauriModule]).includes(messageCmd)) { + if ( + props && + Object.keys(props).includes(tauriModule) && + Object.keys(props[tauriModule]).includes(messageCmd) + ) { + return props[tauriModule][messageCmd] + } else if ( + Object.keys(defaultTauriMockValues).includes(tauriModule) && + Object.keys(defaultTauriMockValues[tauriModule]).includes(messageCmd) + ) { return defaultTauriMockValues[tauriModule][messageCmd] } } diff --git a/applications/launchpad_v2/src/components/KeyboardKeys/types.ts b/applications/launchpad_v2/src/components/KeyboardKeys/types.ts index 41332c3ff3..36a7eb52f1 100644 --- a/applications/launchpad_v2/src/components/KeyboardKeys/types.ts +++ b/applications/launchpad_v2/src/components/KeyboardKeys/types.ts @@ -1,3 +1,3 @@ export interface KeyboardKeysProps { keys: string[] -} \ No newline at end of file +}