feat: support i18n for core component

Signed-off-by: rui ma <ruima@alauda.io>
This commit is contained in:
rui ma
2024-01-08 23:55:00 +08:00
parent 94c4fe2782
commit ff7e12632d
37 changed files with 575 additions and 248 deletions
@@ -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} />,
);