Skip to content

Commit

Permalink
fix: StartingStepOpenWorkspace render
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Orel <oorel@redhat.com>
  • Loading branch information
olexii4 committed Sep 30, 2024
1 parent c5b25c9 commit 211933a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,29 @@ describe('Starting steps, opening an editor', () => {
.build();
});

test('should not show notification alert if STARTING', async () => {
store = new FakeStoreBuilder()
.withDevWorkspaces({
workspaces: [
new DevWorkspaceBuilder()
.withName(workspaceName)
.withNamespace(namespace)
.withStatus({ phase: 'STARTING' })
.build(),
],
})
.build();
renderComponent(store);
jest.runAllTimers();

// trigger timeout
const timeoutButton = screen.queryByRole('button', {
name: 'onTimeout',
});
expect(timeoutButton).toBeNull();
expect(mockOnError).not.toHaveBeenCalled();
});

test('notification alert', async () => {
renderComponent(store);
jest.runAllTimers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ class StartingStepOpenWorkspace extends ProgressStep<Props, State> {
render(): React.ReactNode {
const { distance, hasChildren } = this.props;
const { name, lastError } = this.state;

const isActive = distance === 0;
const workspace = this.findTargetWorkspace(this.props);
const isActive = workspace?.isRunning && distance === 0;
const isError = false;
const isWarning = lastError !== undefined;

Expand Down

0 comments on commit 211933a

Please sign in to comment.