diff --git a/frontend/src/component/application/ApplicationOverview.tsx b/frontend/src/component/application/ApplicationOverview.tsx index 8583ef3ced..b38d41cdfc 100644 --- a/frontend/src/component/application/ApplicationOverview.tsx +++ b/frontend/src/component/application/ApplicationOverview.tsx @@ -79,7 +79,7 @@ const ApplicationOverview = () => { - Projects using this application + Application is connected to these projects: {data.projects.map((project) => ( { + const handleClose = () => { + setOpen(false); + }; + return ( { - setOpen(false); - }} + onClose={handleClose} > - {typeof children === 'string' ? ( - {children} - ) : ( - children - )} + { + const target = e.target as HTMLElement; + if (target.nodeName === 'A') { + handleClose(); + } + }} + > + {typeof children === 'string' ? ( + {children} + ) : ( + children + )} + ); }; diff --git a/frontend/src/component/banners/OutdatedSdksBanner/OutdatedSdksBanner.test.tsx b/frontend/src/component/banners/OutdatedSdksBanner/OutdatedSdksBanner.test.tsx index 398ce42197..af1d417cbe 100644 --- a/frontend/src/component/banners/OutdatedSdksBanner/OutdatedSdksBanner.test.tsx +++ b/frontend/src/component/banners/OutdatedSdksBanner/OutdatedSdksBanner.test.tsx @@ -1,4 +1,4 @@ -import { screen } from '@testing-library/react'; +import { screen, waitFor } from '@testing-library/react'; import { render } from 'utils/testRenderer'; import { testServerRoute, testServerSetup } from 'utils/testServer'; import { OutdatedSdksSchema } from 'openapi'; @@ -30,7 +30,14 @@ test('Show outdated SDKs and apps using them', async () => { link.click(); + await screen.findByText('Outdated SDKs'); await screen.findByText('unleash-node-client:3.2.1'); - await screen.findByText('application1'); + const application = await screen.findByText('application1'); await screen.findByText('application2'); + + application.click(); // clicking on an application link should close the modal + + await waitFor(() => { + expect(screen.queryByText('Outdated SDKs')).not.toBeInTheDocument(); + }); }); diff --git a/src/server-dev.ts b/src/server-dev.ts index 5fe2746420..24d3b48add 100644 --- a/src/server-dev.ts +++ b/src/server-dev.ts @@ -50,6 +50,7 @@ process.nextTick(async () => { executiveDashboard: true, userAccessUIEnabled: true, sdkReporting: true, + outdatedSdksBanner: true, globalFrontendApiCache: true, returnGlobalFrontendApiCache: true, },