@@ -84,6 +84,19 @@ describe('CatalogTable component', () => {
|
||||
).resolves.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should a custom title and subtitle when passed in', async () => {
|
||||
await renderInTestApp(
|
||||
<ApiProvider apis={mockApis}>
|
||||
<MockEntityListContextProvider>
|
||||
<CatalogTable title="My Title" subtitle="My Subtitle" />
|
||||
</MockEntityListContextProvider>
|
||||
</ApiProvider>,
|
||||
);
|
||||
|
||||
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(
|
||||
<ApiProvider apis={mockApis}>
|
||||
|
||||
@@ -63,6 +63,22 @@ describe('CursorPaginatedCatalogTable', () => {
|
||||
);
|
||||
};
|
||||
|
||||
it('should display the title and subtitle when passed in', async () => {
|
||||
await renderInTestApp(
|
||||
wrapInContext(
|
||||
<CursorPaginatedCatalogTable
|
||||
data={data}
|
||||
columns={columns}
|
||||
title="My Title"
|
||||
subtitle="My Subtitle"
|
||||
/>,
|
||||
),
|
||||
);
|
||||
|
||||
expect(screen.queryByText('My Title')).toBeInTheDocument();
|
||||
expect(screen.queryByText('My Subtitle')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should display all the items', async () => {
|
||||
await renderInTestApp(
|
||||
wrapInContext(
|
||||
|
||||
@@ -62,6 +62,28 @@ describe('OffsetPaginatedCatalogTable', () => {
|
||||
);
|
||||
};
|
||||
|
||||
it('should display the title and subtitle when passed in', async () => {
|
||||
await renderInTestApp(
|
||||
wrapInContext(
|
||||
<OffsetPaginatedCatalogTable
|
||||
data={data}
|
||||
columns={columns}
|
||||
title="My Title"
|
||||
subtitle="My Subtitle"
|
||||
/>,
|
||||
{
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user