Test call to action message when no entities are starred

Signed-off-by: Esther Annorzie <eannorzie@indeed.com>
This commit is contained in:
Esther Annorzie
2022-11-22 18:05:10 -05:00
parent c3952ada9f
commit b5e28f94fb
@@ -82,4 +82,34 @@ describe('StarredEntitiesContent', () => {
'/catalog/default/component/mock-starred-entity-2',
);
});
it('should display call to action 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 />
</TestApiProvider>,
{
mountedRoutes: {
'/catalog/:namespace/:kind/:name': entityRouteRef,
},
},
);
expect(
getByText('Click the star beside an entity name to add it to this list!'),
).toBeInTheDocument();
});
});