api-definition-card: fix tests

Signed-off-by: Vincenzo Scamporlino <me@vinzscam.dev>
This commit is contained in:
Vincenzo Scamporlino
2021-08-19 12:48:36 +02:00
parent 8be8f66ea7
commit de1604fc31
@@ -111,7 +111,7 @@ paths:
},
};
const { getByText } = await renderInTestApp(
const { getByText, getAllByText } = await renderInTestApp(
<Wrapper>
<EntityProvider entity={apiEntity}>
<ApiDefinitionCard />
@@ -121,6 +121,10 @@ paths:
expect(getByText(/my-name/i)).toBeInTheDocument();
expect(getByText(/custom-type/i)).toBeInTheDocument();
expect(getByText(/Custom Definition/i)).toBeInTheDocument();
expect(
getAllByText(
(_text, element) => element?.textContent === 'Custom Definition',
).length,
).toBeGreaterThan(0);
});
});