Skip to content

Commit 141210f

Browse files
committed
chore: handle starting as mode where stop should be visible
might be related to podman-desktop#6863 Signed-off-by: Florent Benoit <[email protected]>
1 parent 6a79514 commit 141210f

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

packages/renderer/src/lib/extensions/InstalledExtensionCardLeftLifecycleStop.spec.ts

+27
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,30 @@ test('Expect unable to stop if already stopped', async () => {
9898
const button = screen.queryByRole('button', { name: 'Stop' });
9999
expect(button).not.toBeInTheDocument();
100100
});
101+
102+
test('Expect to stop pd Extension if starting', async () => {
103+
const extension: CombinedExtensionInfoUI = {
104+
type: 'pd',
105+
id: 'idExtension',
106+
name: 'fooName',
107+
description: 'my description',
108+
displayName: '',
109+
publisher: '',
110+
removable: true,
111+
version: 'v1.2.3',
112+
state: 'starting',
113+
path: '',
114+
readme: '',
115+
};
116+
render(InstalledExtensionCardLeftLifecycleStop, { extension });
117+
118+
// get button with label 'Stop'
119+
const button = screen.getByRole('button', { name: 'Stop' });
120+
expect(button).toBeInTheDocument();
121+
122+
// click the button
123+
await fireEvent.click(button);
124+
125+
// expect the delete function to be called
126+
expect(vi.mocked(window.stopExtension)).toHaveBeenCalledWith('idExtension');
127+
});

packages/renderer/src/lib/extensions/InstalledExtensionCardLeftLifecycleStop.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async function stopExtension(): Promise<void> {
1616
}
1717
</script>
1818

19-
{#if extension.state === 'started'}
19+
{#if extension.state === 'started' || extension.state === 'starting'}
2020
<LoadingIconButton
2121
clickAction="{() => stopExtension()}"
2222
action="stop"

0 commit comments

Comments
 (0)