Closed secondl1ght closed 7 months ago
Thanks for the feedback. This has indeed been an annoyance to me every once in a while.
I will work on this @jamaljsr
Sounds good. Thank you!
HI @jamaljsr, I am having a blocker.
I worked on a solution for this issue but I noticed that the test failed.
My implementation involves leveraging electron's 'before-quit' when a user exits polar and sending a message to the renderer process from main process. Now the blocker I have is that I imported ipcRenderer
from electron in a react component and I used it to listen to messages from the main process. This works fine during development but a test always fails.
I tried a couple of solutions I found online including adding a preload.js script and exposing ipcRenderer through contextBridge. None seems to be working.
So I would appreciate it if you could advise me on how I can access ipcRendrer or point me to resources. I think that would really help.
Hey @Abdulkbk, have you tried mocking the ipcRenderer
's methods using jest.fn()
? I've done this before in the ipcService tests.
Another approach that may work is to use jest.mock('electron');
to mock the entire library, but this way requires filling in more of the exposed API.
Something like this:
jest.mock('electron', () => ({
ipcRenderer: {
on: jest.fn(),
removeAllListeners: jest.fn(),
},
}));
Hey @Abdulkbk, have you tried mocking the
ipcRenderer
's methods usingjest.fn()
? I've done this before in the ipcService tests.Another approach that may work is to use
jest.mock('electron');
to mock the entire library, but this way requires filling in more of the exposed API.Something like this:
jest.mock('electron', () => ({ ipcRenderer: { on: jest.fn(), removeAllListeners: jest.fn(), }, }));
Alright. I would mock ipcRenderer
's method and see if the test will pass.
I mocked ipcRenderer and it worked @jamaljsr.
I've submitted a PR. I'll wait for your review and feedback. Thank you
Describe the bug When exiting out of the application and then running
docker ps
it looks like the docker containers do not shut down and continue running after the GUI has been closed.To Reproduce Steps to reproduce the behavior:
Expected behavior Docker containers get shutdown when GUI is closed.
Desktop (please complete the following information):
Additional context If I have missed something please let me know.