diff --git a/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx
index 17bec9a475..2e215e75f9 100644
--- a/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx
+++ b/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx
@@ -111,14 +111,14 @@ describe('', () => {
await renderInTestApp(wrapper, {
mountedRoutes: {
- '/entity/{kind}/{namespace}/{name}': entityRouteRef,
+ '/entity/:kind/:namespace/:name': entityRouteRef,
},
});
expect(screen.getByText('Catalog Graph')).toBeInTheDocument();
- expect(await screen.findByText('b:d/c')).toBeInTheDocument();
- expect(await screen.findByText('b:d/e')).toBeInTheDocument();
- expect(await screen.findAllByTestId('node')).toHaveLength(2);
+ await expect(screen.findByText('b:d/c')).resolves.toBeInTheDocument();
+ await expect(screen.findByText('b:d/e')).resolves.toBeInTheDocument();
+ await expect(screen.findAllByTestId('node')).resolves.toHaveLength(2);
expect(catalog.getEntityByRef).toHaveBeenCalledTimes(2);
});
@@ -129,7 +129,7 @@ describe('', () => {
await renderInTestApp(wrapper, {
mountedRoutes: {
- '/entity/{kind}/{namespace}/{name}': entityRouteRef,
+ '/entity/:kind/:namespace/:name': entityRouteRef,
},
});
@@ -147,15 +147,15 @@ describe('', () => {
await renderInTestApp(wrapper, {
mountedRoutes: {
- '/entity/{kind}/{namespace}/{name}': entityRouteRef,
+ '/entity/:kind/:namespace/:name': entityRouteRef,
},
});
- expect(await screen.findAllByTestId('node')).toHaveLength(2);
+ await expect(screen.findAllByTestId('node')).resolves.toHaveLength(2);
await userEvent.click(screen.getByText('b:d/e'));
- expect(await screen.findByText('hasPart')).toBeInTheDocument();
+ await expect(screen.findByText('hasPart')).resolves.toBeInTheDocument();
});
test('should navigate to entity', async () => {
@@ -165,16 +165,16 @@ describe('', () => {
await renderInTestApp(wrapper, {
mountedRoutes: {
- '/entity/{kind}/{namespace}/{name}': entityRouteRef,
+ '/entity/:kind/:namespace/:name': entityRouteRef,
},
});
- expect(await screen.findAllByTestId('node')).toHaveLength(2);
+ await expect(screen.findAllByTestId('node')).resolves.toHaveLength(2);
const user = userEvent.setup();
await user.keyboard('{Shift>}');
await user.click(screen.getByText('b:d/e'));
- expect(navigate).toHaveBeenCalledWith('/entity/{kind}/{namespace}/{name}');
+ expect(navigate).toHaveBeenCalledWith('/entity/b/d/e');
});
test('should capture analytics event when selecting other entity', async () => {
@@ -189,15 +189,12 @@ describe('', () => {
,
{
mountedRoutes: {
- '/entity/{kind}/{namespace}/{name}': entityRouteRef,
+ '/entity/:kind/:namespace/:name': entityRouteRef,
},
},
);
- expect(await screen.findAllByTestId('node')).toHaveLength(2);
-
- // We wait a bit here to reliably reproduce an issue where that requires the `baseVal` and `view` mocks
- await new Promise(r => setTimeout(r, 100));
+ await expect(screen.findAllByTestId('node')).resolves.toHaveLength(2);
await userEvent.click(screen.getByText('b:d/e'));
@@ -219,12 +216,12 @@ describe('', () => {
,
{
mountedRoutes: {
- '/entity/{kind}/{namespace}/{name}': entityRouteRef,
+ '/entity/:kind/:namespace/:name': entityRouteRef,
},
},
);
- expect(await screen.findAllByTestId('node')).toHaveLength(2);
+ await expect(screen.findAllByTestId('node')).resolves.toHaveLength(2);
const user = userEvent.setup();
await user.keyboard('{Shift>}');
@@ -234,7 +231,7 @@ describe('', () => {
action: 'click',
subject: 'b:d/e',
attributes: {
- to: '/entity/{kind}/{namespace}/{name}',
+ to: '/entity/b/d/e',
},
});
});
diff --git a/plugins/gocd/src/components/Select/Select.test.tsx b/plugins/gocd/src/components/Select/Select.test.tsx
index 9d73194ed8..c93b5dd148 100644
--- a/plugins/gocd/src/components/Select/Select.test.tsx
+++ b/plugins/gocd/src/components/Select/Select.test.tsx
@@ -66,7 +66,7 @@ describe('Select', () => {
/>,
);
user.tab();
- userEvent.keyboard('{enter}');
+ await userEvent.keyboard('{enter}');
expect(rendered.getAllByText(testItems[0].label)).toHaveLength(2);
expect(rendered.getByText(testItems[1].label)).toBeInTheDocument();