feat: support i18n for core component
Signed-off-by: rui ma <ruima@alauda.io>
This commit is contained in:
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import { TechDocsSearchResultListItem } from './TechDocsSearchResultListItem';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
|
||||
// Using canvas to render text..
|
||||
jest.mock('react-text-truncate', () => {
|
||||
@@ -46,7 +46,7 @@ const validResultWithTitle = {
|
||||
|
||||
describe('TechDocsSearchResultListItem test', () => {
|
||||
it('should render search doc passed in', async () => {
|
||||
const { findByText } = render(
|
||||
const { findByText } = await renderInTestApp(
|
||||
<TechDocsSearchResultListItem result={validResult} />,
|
||||
);
|
||||
|
||||
@@ -61,7 +61,7 @@ describe('TechDocsSearchResultListItem test', () => {
|
||||
});
|
||||
|
||||
it('should use title if defined', async () => {
|
||||
const { findByText } = render(
|
||||
const { findByText } = await renderInTestApp(
|
||||
<TechDocsSearchResultListItem
|
||||
result={validResult}
|
||||
title="Count Dookumentation"
|
||||
@@ -77,7 +77,7 @@ describe('TechDocsSearchResultListItem test', () => {
|
||||
});
|
||||
|
||||
it('should use entity title if defined', async () => {
|
||||
const { findByText } = render(
|
||||
const { findByText } = await renderInTestApp(
|
||||
<TechDocsSearchResultListItem result={validResultWithTitle} />,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user