diff --git a/src/generic/toast-context/index.test.tsx b/src/generic/toast-context/index.test.tsx index 21fa78143..11294b069 100644 --- a/src/generic/toast-context/index.test.tsx +++ b/src/generic/toast-context/index.test.tsx @@ -9,7 +9,6 @@ export interface WraperProps { children: React.ReactNode; } -// eslint-disable-next-line react/prop-types const TestComponentToShow = () => { const { showToast } = React.useContext(ToastContext); diff --git a/src/library-authoring/library-team/LibraryTeam.test.tsx b/src/library-authoring/library-team/LibraryTeam.test.tsx index fd50a0927..bdd424fc0 100644 --- a/src/library-authoring/library-team/LibraryTeam.test.tsx +++ b/src/library-authoring/library-team/LibraryTeam.test.tsx @@ -211,7 +211,7 @@ describe('', () => { it('shows error', async () => { const url = getLibraryTeamApiUrl(libraryId); const axiosMock = new MockAdapter(getAuthenticatedHttpClient()); - axiosMock.onPost(url).reply(400, { error: 'Error' }); + axiosMock.onPost(url).reply(400, {}); await renderLibraryTeam(); diff --git a/src/library-authoring/library-team/LibraryTeam.tsx b/src/library-authoring/library-team/LibraryTeam.tsx index dcb882079..8bf4d2e31 100644 --- a/src/library-authoring/library-team/LibraryTeam.tsx +++ b/src/library-authoring/library-team/LibraryTeam.tsx @@ -66,8 +66,8 @@ const LibraryTeam: React.FC> = () => { }).then(() => { showToast(intl.formatMessage(messages.addMemberSuccess)); }).catch((addMemberError) => { - const errorData = addMemberError.response.data; - if ('email' in errorData) { + const errorData = typeof addMemberError === 'object' ? addMemberError.response?.data : undefined; + if (errorData && 'email' in errorData) { showToast(intl.formatMessage(messages.addMemberEmailError)); } else { showToast(intl.formatMessage(messages.addMemberError));