Skip to content

Commit

Permalink
Fix dataTypesToSign (#13357)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlqn authored Aug 15, 2024
1 parent 6df9dc7 commit 1ed88b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,31 @@ describe('ProcessEditor', () => {
});

it('renders spinner when appLibVersion is not fetched', () => {
renderProcessEditor();
const queryClientMock = createQueryClientMock();
queryClientMock.setQueryData([QueryKey.AppMetadata, org, app], []);
renderProcessEditor({ queryClient: queryClientMock });
screen.getByText(textMock('process_editor.loading'));
});

it('renders spinner when appMetadata is not fetched', () => {
const queryClientMock = createQueryClientMock();
queryClientMock.setQueryData([QueryKey.AppVersion, org, app], defaultAppVersion);
renderProcessEditor({ queryClient: queryClientMock });
screen.getByText(textMock('process_editor.loading'));
});

it('renders processEditor with "noBpmnFound" error message when appLibVersion is fetched but no bpmn is found', () => {
const queryClientMock = createQueryClientMock();
queryClientMock.setQueryData([QueryKey.AppVersion, org, app], defaultAppVersion);
queryClientMock.setQueryData([QueryKey.AppMetadata, org, app], []);
renderProcessEditor({ queryClient: queryClientMock });
screen.getByRole('heading', { name: textMock('process_editor.fetch_bpmn_error_title') });
});

it('renders processEditor with "No task selected" message in config panel when appLibVersion is fetched but no bpmnDetails are found', () => {
const queryClientMock = createQueryClientMock();
queryClientMock.setQueryData([QueryKey.AppVersion, org, app], defaultAppVersion);
queryClientMock.setQueryData([QueryKey.AppMetadata, org, app], []);
(useBpmnContext as jest.Mock).mockReturnValue({
bpmnDetails: null,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const ProcessEditor = (): React.ReactElement => {
onProcessTaskRemoveHandler.handleOnProcessTaskRemove(taskMetadata);
};

if (appLibDataLoading) {
if (appLibDataLoading || appMetadataPending) {
return <StudioPageSpinner spinnerTitle={t('process_editor.loading')} showSpinnerTitle />;
}

Expand Down

0 comments on commit 1ed88b2

Please sign in to comment.