-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: properly update starting sub-steps
- Loading branch information
Showing
13 changed files
with
510 additions
and
414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...aceProgress/StartingSteps/WorkspaceConditions/__tests__/__snapshots__/index.spec.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Starting steps, checking workspace conditions snapshot - condition failed 1`] = ` | ||
<div> | ||
<div | ||
data-testid="isError" | ||
/> | ||
<div | ||
data-testid="distance" | ||
> | ||
1 | ||
</div> | ||
<span | ||
className="done" | ||
data-testid="step-title" | ||
> | ||
Something happened | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`Starting steps, checking workspace conditions snapshot - condition in-progress 1`] = ` | ||
<div> | ||
<div | ||
data-testid="distance" | ||
> | ||
0 | ||
</div> | ||
<span | ||
className="progress" | ||
data-testid="step-title" | ||
> | ||
Preparing networking | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`Starting steps, checking workspace conditions snapshot - condition ready 1`] = ` | ||
<div> | ||
<div | ||
data-testid="distance" | ||
> | ||
1 | ||
</div> | ||
<span | ||
className="done" | ||
data-testid="step-title" | ||
> | ||
Networking ready | ||
</span> | ||
</div> | ||
`; |
107 changes: 107 additions & 0 deletions
107
.../src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/fixtures.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* | ||
* Copyright (c) 2018-2023 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
|
||
import { ConditionType } from '../../../utils'; | ||
|
||
export const conditionChangedTo: { | ||
[key: string]: [condition: ConditionType, prevCondition: ConditionType | undefined]; | ||
} = { | ||
inProgress1: [ | ||
{ | ||
status: 'False', | ||
type: 'Started', | ||
}, | ||
undefined, | ||
], | ||
inProgress2: [ | ||
{ | ||
status: 'False', | ||
type: 'Started', | ||
}, | ||
{ | ||
status: 'False', | ||
type: 'Started', | ||
}, | ||
], | ||
|
||
done1: [ | ||
{ | ||
status: 'True', | ||
type: 'Started', | ||
}, | ||
{ | ||
status: 'False', | ||
type: 'Started', | ||
}, | ||
], | ||
done2: [ | ||
{ | ||
status: 'Unknown', | ||
type: 'Started', | ||
}, | ||
{ | ||
status: 'True', | ||
type: 'Started', | ||
}, | ||
], | ||
|
||
fail1: [ | ||
{ | ||
status: 'Unknown', | ||
type: 'Started', | ||
}, | ||
{ | ||
status: 'False', | ||
type: 'Started', | ||
}, | ||
], | ||
fail2: [ | ||
{ | ||
status: 'False', | ||
type: 'Started', | ||
message: 'Workspace stopped due to error', | ||
}, | ||
{ | ||
status: 'Unknown', | ||
type: 'Started', | ||
}, | ||
], | ||
fail3: [ | ||
{ | ||
status: 'True', | ||
type: 'Started', | ||
reason: 'Failed', | ||
}, | ||
undefined, | ||
], | ||
}; | ||
|
||
export const conditionStatusFalse: ConditionType = { | ||
message: 'Preparing networking', | ||
status: 'False', | ||
type: 'RoutingReady', | ||
}; | ||
export const conditionStatusTrue: ConditionType = { | ||
message: 'Networking ready', | ||
status: 'True', | ||
type: 'RoutingReady', | ||
}; | ||
export const conditionError: ConditionType = { | ||
status: 'True', | ||
type: 'FailedStart', | ||
reason: 'Failure', | ||
message: 'Something happened', | ||
}; | ||
export const conditionStatusUnknown: ConditionType = { | ||
status: 'Unknown', | ||
type: 'RoutingReady', | ||
}; |
Oops, something went wrong.