Test user provided message if no entities are starred

Signed-off-by: Esther Annorzie <eannorzie@indeed.com>
This commit is contained in:
Esther Annorzie
2022-11-30 12:22:18 -05:00
parent bfe38c80ea
commit dbd2480a1a
@@ -112,4 +112,32 @@ describe('StarredEntitiesContent', () => {
getByText('Click the star beside an entity name to add it to this list!'),
).toBeInTheDocument();
});
it('should display user provided message if no entities are starred', async () => {
const mockedApi = new MockStarredEntitiesApi();
const mockCatalogApi = {
getEntities: jest
.fn()
.mockImplementation(async () => ({ items: entities })),
};
const { getByText } = await renderInTestApp(
<TestApiProvider
apis={[
[catalogApiRef, mockCatalogApi],
[starredEntitiesApiRef, mockedApi],
]}
>
<Content noStarredEntitiesMessage="foo" />
</TestApiProvider>,
{
mountedRoutes: {
'/catalog/:namespace/:kind/:name': entityRouteRef,
},
},
);
expect(getByText('foo')).toBeInTheDocument();
});
});