diff --git a/src/signals/incident-management/containers/IncidentDetail/components/DetailHeader/index.js b/src/signals/incident-management/containers/IncidentDetail/components/DetailHeader/index.js index 72e6c75f1b..e9f62d8151 100644 --- a/src/signals/incident-management/containers/IncidentDetail/components/DetailHeader/index.js +++ b/src/signals/incident-management/containers/IncidentDetail/components/DetailHeader/index.js @@ -75,16 +75,13 @@ const DetailHeader = () => { return true }, [incident]) - const forwardToExternalIsAllowed = !isStatusClosed(incident.status?.state) - const thorIsAllowed = [ - 'm', - 'i', - 'b', - 'h', - 'send failed', - 'reopened', - ].includes(incident.status?.state) + const thorIsAllowed = + ['m', 'i', 'b', 'h', 'send failed', 'reopened'].includes( + incident.status?.state + ) && + incident.category?.main_slug !== 'overig' && + incident.category?.sub_slug !== 'overig' const downloadLink = incident?._links?.['sia:pdf']?.href const referrer = location.referrer?.startsWith(MAP_URL) diff --git a/src/signals/incident-management/containers/IncidentDetail/components/DetailHeader/index.test.js b/src/signals/incident-management/containers/IncidentDetail/components/DetailHeader/index.test.js index 8b079dcfd1..7d7c3bd036 100644 --- a/src/signals/incident-management/containers/IncidentDetail/components/DetailHeader/index.test.js +++ b/src/signals/incident-management/containers/IncidentDetail/components/DetailHeader/index.test.js @@ -210,6 +210,21 @@ describe('signals/incident-management/containers/IncidentDetail/components/Detai expect(screen.queryByTestId('detail-header-button-thor')).toBeNull() }) + it('should render no thor button category main and subslug are overig', () => { + render( + renderWithContext({ + ...incidentFixture, + category: { + ...incidentFixture.category, + main_slug: 'overig', + sub_slug: 'overig', + }, + }) + ) + + expect(screen.queryByTestId('detail-header-button-thor')).toBeNull() + }) + it('test clicking the thor button', () => { render(renderWithContext())