From a1ea1db0e04a82dca98ba9aff3373ddded9a9f8c Mon Sep 17 00:00:00 2001 From: Kira Miller Date: Tue, 29 Aug 2023 00:51:29 +0000 Subject: [PATCH] fix: test fixes --- .../SettingsApiCredentialsTab/APICredentialsPage.jsx | 4 ++-- .../tests/SettingsAPICredrentialsPage.test.jsx | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/settings/SettingsApiCredentialsTab/APICredentialsPage.jsx b/src/components/settings/SettingsApiCredentialsTab/APICredentialsPage.jsx index 67c2cf19ac..6d94750c79 100644 --- a/src/components/settings/SettingsApiCredentialsTab/APICredentialsPage.jsx +++ b/src/components/settings/SettingsApiCredentialsTab/APICredentialsPage.jsx @@ -23,11 +23,11 @@ const APICredentialsPage = () => {

Application name: - data?.name + {data?.name}

Allowed URIs: - data?.redirect_uris + {data?.redirect_uris}

API client ID: diff --git a/src/components/settings/SettingsApiCredentialsTab/tests/SettingsAPICredrentialsPage.test.jsx b/src/components/settings/SettingsApiCredentialsTab/tests/SettingsAPICredrentialsPage.test.jsx index b762b56af5..e44ec203c7 100644 --- a/src/components/settings/SettingsApiCredentialsTab/tests/SettingsAPICredrentialsPage.test.jsx +++ b/src/components/settings/SettingsApiCredentialsTab/tests/SettingsAPICredrentialsPage.test.jsx @@ -28,6 +28,7 @@ const returnResponse = { client_id: clientId, client_secret: clientSecret, api_client_documentation: apiClientDocumentation, + redirect_uris: redirectUris, updated, }], }; @@ -36,6 +37,7 @@ const data = { client_id: clientId, client_secret: clientSecret, api_client_documentation: apiClientDocumentation, + redirect_uris: redirectUris, updated, }; const regenerationDate = { @@ -91,7 +93,7 @@ describe('API Credentials Tab', () => { await waitFor(() => expect(mockFetchFn).toHaveBeenCalled()); expect(screen.getByRole('heading', { name: `Application name: ${name}` }).toBeInTheDocument); - expect(screen.getByRole('heading', { name: 'Allowed URIs:' }).toBeInTheDocument); + expect(screen.getByRole('heading', { name: `Allowed URIs: ${redirectUris}` }).toBeInTheDocument); expect(screen.getByRole('heading', { name: `API client ID: ${clientId}` }).toBeInTheDocument); expect(screen.getByRole('heading', { name: `API client secret: ${clientSecret}` }).toBeInTheDocument); expect(screen.getByRole('heading', { name: `API client documentation: ${apiClientDocumentation}` }).toBeInTheDocument); @@ -152,7 +154,7 @@ describe('API Credentials Tab', () => { }); expect(screen.getByRole('heading', { name: `Application name: ${name}` }).toBeInTheDocument); - expect(screen.getByRole('heading', { name: 'Allowed URIs:' }).toBeInTheDocument); + expect(screen.getByRole('heading', { name: `Allowed URIs: ${redirectUris}` }).toBeInTheDocument); expect(screen.getByRole('heading', { name: `API client ID: ${clientId}` }).toBeInTheDocument); expect(screen.getByRole('heading', { name: `API client secret: ${clientSecret}` }).toBeInTheDocument); expect(screen.getByRole('heading', { name: `API client documentation: ${apiClientDocumentation}` }).toBeInTheDocument);