Files
Time4Midi/tests/ui-smoke-preload.cjs
T
jhartworks c396a0f249 Add smoke tests for project file handling and UI interactions
- Implemented a smoke test for project file operations in `project-file-smoke.cjs`, verifying save and load functionality.
- Created a preload script for UI smoke tests in `ui-smoke-preload.cjs`, exposing necessary APIs to the renderer process.
- Developed comprehensive UI smoke tests in `ui-smoke.cjs`, covering various user interactions and ensuring expected behavior.
2026-11-25 09:44:17 +01:00

50 lines
1.3 KiB
JavaScript

const { contextBridge } = require("electron");
const output = {
configure: async () => ({}),
send: async () => ({}),
sendDmx: async () => ({}),
publish: async () => ({}),
onStatus: () => () => {},
onTimecode: () => () => {}
};
contextBridge.exposeInMainWorld("time4midi", {
window: {
customFrame: false,
minimize: async () => {},
toggleMaximize: async () => false,
requestClose: async () => {},
confirmClose: async () => {},
onMaximizedChanged: () => () => {},
onCloseRequested: () => () => {}
},
show: { setActive: async () => {} },
project: {
save: async () => ({ canceled: true }),
load: async () => ({ canceled: true }),
loadRecent: async () => ({ canceled: true })
},
mappingLibraries: {
loadStore: async () => ({ data: {} }),
saveStore: async () => {},
importFile: async () => ({ canceled: true }),
exportFile: async () => ({ canceled: true })
},
network: { listInterfaces: async () => [] },
audio: {
pickFile: async () => ({ canceled: true }),
readFile: async () => ({}),
fileUrl: () => ""
},
diagnostics: { openWindow: async () => {} },
artnet: output,
sacn: output,
osc: output,
mqtt: output,
serial: output,
modbusTcp: output,
modbusRtu: output,
knx: output
});