diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.test.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.test.tsx index 5b7f28e26a..13ee7593b9 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.test.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.test.tsx @@ -84,6 +84,19 @@ describe('CatalogTable component', () => { ).resolves.toBeInTheDocument(); }); + it('should a custom title and subtitle when passed in', async () => { + await renderInTestApp( + + + + + , + ); + + expect(screen.queryByText('My Title')).toBeInTheDocument(); + expect(screen.queryByText('My Subtitle')).toBeInTheDocument(); + }); + it('should display entity names when loading has finished and no error occurred', async () => { await renderInTestApp( diff --git a/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.test.tsx b/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.test.tsx index adc69794ae..b0deec9679 100644 --- a/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.test.tsx +++ b/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.test.tsx @@ -63,6 +63,22 @@ describe('CursorPaginatedCatalogTable', () => { ); }; + it('should display the title and subtitle when passed in', async () => { + await renderInTestApp( + wrapInContext( + , + ), + ); + + expect(screen.queryByText('My Title')).toBeInTheDocument(); + expect(screen.queryByText('My Subtitle')).toBeInTheDocument(); + }); + it('should display all the items', async () => { await renderInTestApp( wrapInContext( diff --git a/plugins/catalog/src/components/CatalogTable/OffsetPaginatedCatalogTable.test.tsx b/plugins/catalog/src/components/CatalogTable/OffsetPaginatedCatalogTable.test.tsx index aad9b7cb3d..e2e73c5af8 100644 --- a/plugins/catalog/src/components/CatalogTable/OffsetPaginatedCatalogTable.test.tsx +++ b/plugins/catalog/src/components/CatalogTable/OffsetPaginatedCatalogTable.test.tsx @@ -62,6 +62,28 @@ describe('OffsetPaginatedCatalogTable', () => { ); }; + it('should display the title and subtitle when passed in', async () => { + await renderInTestApp( + wrapInContext( + , + { + setOffset: jest.fn(), + limit: Number.MAX_SAFE_INTEGER, + offset: 0, + totalItems: data.length, + }, + ), + ); + + expect(screen.queryByText('My Title')).toBeInTheDocument(); + expect(screen.queryByText('My Subtitle')).toBeInTheDocument(); + }); + it('should display all the items', async () => { await renderInTestApp( wrapInContext(