feat: enable WorkspaceKind update in FrontEnd#1093
Conversation
Signed-off-by: Charles Thao <cthao@redhat.com>
Signed-off-by: Charles Thao <cthao@redhat.com>
3851627 to
20ea6c2
Compare
| const updateResult = await safeApiCall(() => | ||
| api.workspaceKinds.updateWorkspaceKind(routeParams?.kind || '', { | ||
| data: convertFormDataToUpdate(data, initialFormData as WorkspacekindsWorkspaceKindUpdate), | ||
| }), | ||
| ); | ||
| if (!updateResult.ok) { | ||
| throw updateResult.errorEnvelope; | ||
| } | ||
| notification.success(`Workspace kind '${routeParams?.kind || ''}' updated successfully`); | ||
| navigate('workspaceKinds'); |
There was a problem hiding this comment.
Should this be inside an else for the if (mode === 'create')?
| requests: v.resources.requests as Record<string, never>, | ||
| limits: v.resources.limits as Record<string, never>, |
There was a problem hiding this comment.
Please consider using V1ResourceList instead of Record<string, never>.
|
|
||
| cy.wait('@updateWorkspaceKindError'); | ||
|
|
||
| cy.get('[data-testid="workspace-kind-form-error"]').should('be.visible'); |
There was a problem hiding this comment.
| cy.get('[data-testid="workspace-kind-form-error"]').should('be.visible'); | |
| cy.findByTestId('workspace-kind-form-error').should('be.visible'); |
|
|
||
| cy.wait('@updateWorkspaceKindError'); | ||
|
|
||
| cy.get('[data-testid="workspace-kind-form-error"]').should('be.visible'); |
There was a problem hiding this comment.
This assertion could be encapsulated as a method in the editWorkspaceKind page object (e.g., assertFormErrorVisible()), rather than using a raw selector in the test file. This keeps selectors centralized and the test more readable.
|
/ok-to-test |
|
No further comments from my side other than Paulo's! |
20ea6c2 to
a8e84ad
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@caponetto @paulovmr fixed the code up! Please re-review |
closes: #1085
canSubmitlogic inWorkspaceKindForm