🚀 feat: Banner (#3952)

* feat: Add banner schema and model

* feat: Add optional JwtAuth

To handle the conditional logic with and without authentication within the model.

* feat: Add an endpoint to retrieve a banner

* feat: Add implementation for client to use banner and access API

* feat: Display a banner on UI

* feat: Script for updating and deleting banners

* style: Update banner style

* fix: Adjust the height when the banner is displayed

* fix: failed specs
This commit is contained in:
Yuichi Oneda 2024-09-11 06:34:25 -07:00 committed by GitHub
parent 07e5531b5b
commit aea01f0bc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 453 additions and 4 deletions

View file

@ -50,6 +50,11 @@ const setup = ({
user: {},
},
},
useGetBannerQueryReturnValue = {
isLoading: false,
isError: false,
data: {},
},
useGetStartupConfigReturnValue = mockStartupConfig,
} = {}) => {
const mockUseRegisterUserMutation = jest
@ -71,6 +76,10 @@ const setup = ({
const mockUseOutletContext = jest.spyOn(reactRouter, 'useOutletContext').mockReturnValue({
startupConfig: useGetStartupConfigReturnValue.data,
});
const mockUseGetBannerQuery = jest
.spyOn(mockDataProvider, 'useGetBannerQuery')
//@ts-ignore - we don't need all parameters of the QueryObserverSuccessResult
.mockReturnValue(useGetBannerQueryReturnValue);
const renderResult = render(
<AuthLayout
startupConfig={useGetStartupConfigReturnValue.data as TStartupConfig}