diff --git a/src/studio-home/StudioHome.test.jsx b/src/studio-home/StudioHome.test.jsx
index ad02f4373f..a1be4506fb 100644
--- a/src/studio-home/StudioHome.test.jsx
+++ b/src/studio-home/StudioHome.test.jsx
@@ -260,3 +260,48 @@ describe('', async () => {
});
});
});
+
+describe('Enable pagination', () => {
+ beforeEach(async () => {
+ initializeMockApp({
+ authenticatedUser: {
+ userId: 3,
+ username: 'abc123',
+ administrator: true,
+ roles: [],
+ },
+ });
+ store = initializeStore();
+ axiosMock = new MockAdapter(getAuthenticatedHttpClient());
+ global.window = Object.create(window);
+ Object.defineProperty(window, 'location', {
+ value: {
+ search: '?search=test',
+ },
+ });
+ });
+
+ const RootWrapperWithPagination = () => (
+
+
+
+
+
+ );
+
+ it('should dispatch fetchStudioHomeData with paginated parameters on component mount', async () => {
+ axiosMock.onGet(getStudioHomeApiUrl()).reply(200, studioHomeMock);
+
+ const { getByText } = render();
+
+ expect(getByText(`${studioShortName} home`)).toBeInTheDocument();
+ });
+
+ it('should only dispatch fetchStudioHomeData once when pagination is enabled', async () => {
+ axiosMock.onGet(getStudioHomeApiUrl()).reply(200, studioHomeMock);
+
+ render();
+
+ expect(axiosMock.history.get.length).toBe(1);
+ });
+});