chore: added some more tests for the TemplateListPage
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user