Skip to content

Commit

Permalink
fix: edit button should be visible during started and stopped
Browse files Browse the repository at this point in the history
fixes podman-desktop#7045
Signed-off-by: Florent Benoit <[email protected]>
  • Loading branch information
benoitf committed May 2, 2024
1 parent 7376bc8 commit 10b8e7d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
37 changes: 37 additions & 0 deletions packages/renderer/src/lib/ui/LoadingIconButton.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,43 @@ test.each([
},
expected: EXPECT_DISABLE,
},
// edit action
{
name: 'edit action in started status should be enabled',
action: 'edit',
state: {
status: 'started',
inProgress: false,
},
expected: EXPECT_ENABLE,
},
{
name: 'edit action in unknown status should be disabled',
action: 'edit',
state: {
status: 'unknown',
inProgress: false,
},
expected: EXPECT_DISABLE,
},
{
name: 'edit action in starting status should be disabled',
action: 'edit',
state: {
status: 'starting',
inProgress: false,
},
expected: EXPECT_DISABLE,
},
{
name: 'edit action if in progress should be disabled',
action: 'edit',
state: {
status: 'started',
inProgress: true,
},
expected: EXPECT_DISABLE,
},
] as TestScenario[])('$name', ({ action, color, state, expected }) => {
render(LoadingIconButton, {
action: action,
Expand Down
3 changes: 3 additions & 0 deletions packages/renderer/src/lib/ui/LoadingIconButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ $: {
case 'update':
disable = state?.status === 'unknown';
break;
case 'edit':
disable = state?.status !== 'started' && state?.status !== 'stopped';
break;
}
}
}
Expand Down

0 comments on commit 10b8e7d

Please sign in to comment.