mirror of
https://github.com/podman-desktop/podman-desktop
synced 2026-05-24 02:08:24 +00:00
fix: missing emit so clients on the 'main' side could not be notified
Signed-off-by: Florent Benoit <fbenoit@redhat.com>
This commit is contained in:
parent
cf5033d374
commit
6f11e8bca6
2 changed files with 17 additions and 0 deletions
|
|
@ -175,3 +175,19 @@ test('Check SecurityRestrictions on known domains', async () => {
|
|||
// expect openExternal has been called
|
||||
expect(shell.openExternal).toBeCalledWith('https://www.podman-desktop.io');
|
||||
});
|
||||
|
||||
test('Should apiSender handle local receive events', async () => {
|
||||
const apiSender = pluginSystem.getApiSender(webContents);
|
||||
expect(apiSender).toBeDefined();
|
||||
|
||||
let fooReceived = '';
|
||||
apiSender.receive('foo', (data: any) => {
|
||||
fooReceived = String(data);
|
||||
});
|
||||
|
||||
// try to send data
|
||||
apiSender.send('foo', 'hello-world');
|
||||
|
||||
// data should have been received
|
||||
expect(fooReceived).toBe('hello-world');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -281,6 +281,7 @@ export class PluginSystem {
|
|||
// add to the queue
|
||||
queuedEvents.push({ channel, data });
|
||||
}
|
||||
eventEmitter.emit(channel, data);
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
receive: (channel: string, func: any) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue