chore: added some more tests for the TemplateListPage

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-02-25 13:52:56 +01:00
parent df0d2e7d97
commit 1c05488c92
2 changed files with 35 additions and 2 deletions
@@ -71,7 +71,7 @@ describe('TemplateListPage', () => {
expect(getByRole('menuitem', { name: 'Starred' })).toBeInTheDocument();
});
it('should render the category picker', () => {
it('should render the category picker', async () => {
const { getByText } = await renderInTestApp(
<TestApiProvider
apis={[
@@ -91,4 +91,38 @@ describe('TemplateListPage', () => {
expect(getByText('Categories')).toBeInTheDocument();
});
it('should render the EntityTag picker', async () => {
const { getByText } = await renderInTestApp(
<TestApiProvider
apis={[
[
catalogApiRef,
{
getEntities: async () => ({
items: [
{
apiVersion: 'scaffolder.backstage.io/v1beta3',
kind: 'Template',
metadata: { name: 'blob', tags: ['blob'] },
},
],
}),
},
],
[
starredEntitiesApiRef,
new DefaultStarredEntitiesApi({
storageApi: MockStorageApi.create(),
}),
],
[permissionApiRef, {}],
]}
>
<TemplateListPage />
</TestApiProvider>,
);
expect(getByText('Tags')).toBeInTheDocument();
});
});
@@ -21,7 +21,6 @@ import { makeStyles } from '@material-ui/core';
import {
Content,
ContentHeader,
CreateButton,
Header,
Lifecycle,
Page,