Skip to content

Commit 5bf8241

Browse files
committed
Add loading feedback to refresh logs button
1 parent f20085e commit 5bf8241

3 files changed

Lines changed: 24 additions & 15 deletions

File tree

packages/ui/src/components/ConfigureSSO/__tests__/ConfigureSSO.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ describe('ConfigureSSO', () => {
2424

2525
const { findByText, queryByText } = render(<ConfigureSSO />, { wrapper });
2626

27-
await findByText(/you do not have permission to manage enterprise connections/i);
28-
expect(queryByText(/contact your organization administrator in order to have permissions/i)).toBeInTheDocument();
29-
expect(queryByText(/select provider/i)).not.toBeInTheDocument();
27+
await findByText(/you do not have permission to manage single sign-on/i);
28+
expect(queryByText(/contact your organization.*administrator to upgrade your permissions/i)).toBeInTheDocument();
29+
expect(queryByText(/select your identity provider/i)).not.toBeInTheDocument();
3030
});
3131

3232
it('renders the wizard when the active organization membership has the manage enterprise connections permission', async () => {
@@ -45,9 +45,9 @@ describe('ConfigureSSO', () => {
4545
const { findByText, queryByText } = render(<ConfigureSSO />, { wrapper });
4646

4747
await waitFor(() => {
48-
expect(queryByText(/you do not have permission to manage enterprise connections/i)).not.toBeInTheDocument();
48+
expect(queryByText(/you do not have permission to manage single sign-on/i)).not.toBeInTheDocument();
4949
});
50-
await findByText(/select provider/i);
50+
await findByText(/select your identity provider/i);
5151
});
5252
});
5353

@@ -63,8 +63,8 @@ describe('ConfigureSSO', () => {
6363

6464
const { findByText, queryByText } = render(<ConfigureSSO />, { wrapper });
6565

66-
await findByText(/select provider/i);
67-
expect(queryByText(/you do not have permission to manage enterprise connections/i)).not.toBeInTheDocument();
66+
await findByText(/select your identity provider/i);
67+
expect(queryByText(/you do not have permission to manage single sign-on/i)).not.toBeInTheDocument();
6868
});
6969
});
7070
});

packages/ui/src/components/ConfigureSSO/steps/TestConfigurationStep.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ export const TestConfigurationStep = (): JSX.Element => {
5656
data: testRuns,
5757
totalCount,
5858
isLoading: areTestRunsLoading,
59+
isFetching: areTestRunsFetching,
5960
isPolling,
6061
revalidate: revalidateTestRuns,
6162
} = __internal_useEnterpriseConnectionTestRuns({
6263
enterpriseConnectionId: enterpriseConnection?.id ?? null,
6364
params: { initialPage: currentPage, pageSize: TEST_RUNS_PAGE_SIZE },
6465
});
6566

67+
const isRefreshingTestRuns = areTestRunsFetching && !areTestRunsLoading;
6668
const pageCount = totalCount ? Math.ceil(totalCount / TEST_RUNS_PAGE_SIZE) : 0;
6769

6870
const handleTestRunCreated = () => {
@@ -112,14 +114,21 @@ export const TestConfigurationStep = (): JSX.Element => {
112114
colorScheme='secondary'
113115
size='xs'
114116
onClick={() => void revalidateTestRuns()}
115-
isDisabled={areTestRunsLoading}
117+
isDisabled={isRefreshingTestRuns}
116118
sx={t => ({ gap: t.space.$1x5 })}
117119
>
118-
<Icon
119-
icon={RotateLeftRight}
120-
size='sm'
121-
colorScheme='neutral'
122-
/>
120+
{isRefreshingTestRuns ? (
121+
<Spinner
122+
elementDescriptor={descriptors.spinner}
123+
size='xs'
124+
/>
125+
) : (
126+
<Icon
127+
icon={RotateLeftRight}
128+
size='sm'
129+
colorScheme='neutral'
130+
/>
131+
)}
123132
<Text
124133
as='span'
125134
localizationKey={localizationKeys(

packages/ui/src/components/ConfigureSSO/steps/__tests__/SelectProviderStep.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ describe('SelectProviderStep', () => {
9898
const { wrapper } = await createFixtures();
9999
renderStep(wrapper);
100100

101-
expect(screen.getByRole('heading', { name: 'Select provider' })).toBeInTheDocument();
102-
expect(screen.getByText('Select your identity provider')).toBeInTheDocument();
101+
expect(screen.getByRole('heading', { name: 'Select your identity provider' })).toBeInTheDocument();
102+
expect(screen.getByText(/We.*ll guide you through the detailed setup process next\./)).toBeInTheDocument();
103103
});
104104

105105
it('renders both SAML provider radios with their labels', async () => {

0 commit comments

Comments
 (0)