8000 test(extensions/podman): check notification showed again when podman … · podman-desktop/podman-desktop@9cf4bd6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9cf4bd6

Browse files
committed
test(extensions/podman): check notification showed again when podman uninstalled on Linux
Signed-off-by: Simon Rey <sfbrey+eqqe@gmail.com>
1 parent c5d7df1 commit 9cf4bd6

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

extensions/podman/packages/extension/src/extension.spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3520,6 +3520,31 @@ describe('Check notify podman setup', () => {
35203520

35213521
expect(extensionApi.window.showNotification).not.toHaveBeenCalled();
35223522
});
3523+
3524+
test('reset the notification flag so if podman is uninstalled in future we can show the notification again', async () => {
3525+
vi.mocked(extensionApi.env).isLinux = true;
3526+
3527+
// No podman install
3528+
3529+
await extension.doMonitorProvider(provider);
3530+
expect(extensionApi.window.showNotification).toHaveBeenCalledExactlyOnceWith(notifySetupPodmanExpectedContent);
3531+
3532+
// Podman has been installed
3533+
3534+
vi.mocked(extensionApi.process.exec).mockResolvedValueOnce({
3535+
stdout: 'podman version 5.0.0',
3536+
} as unknown as extensionApi.RunResult);
3537+
3538+
await extension.doMonitorProvider(provider);
3539+
3540+
expect(extensionApi.window.showNotification).toHaveBeenCalledExactlyOnceWith(notifySetupPodmanExpectedContent);
3541+
3542+
// Podman has been uninstalled -> Show the notification a second time
3543+
3544+
await extension.doMonitorProvider(provider);
3545+
expect(extensionApi.window.showNotification).toHaveBeenCalledTimes(2);
3546+
expect(extensionApi.window.showNotification).toHaveBeenLastCalledWith(notifySetupPodmanExpectedContent);
3547+
});
35233548
});
35243549

35253550
describe('monitorProvider', () => {

0 commit comments

Comments
 (0)
0