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 { BitriseBuildsComponent } from './BitriseBuildsComponent';
import { renderInTestApp } from '@backstage/test-utils';
let entityValue: {
entity: { metadata: { annotations?: { [key: string]: string } } };
@@ -48,10 +48,10 @@ jest.mock('../BitriseBuildsTableComponent', () => ({
describe('BitriseArtifactsComponent', () => {
entityValue = { entity: { metadata: {} } };
const renderComponent = () => render(<BitriseBuildsComponent />);
const renderComponent = () => renderInTestApp(<BitriseBuildsComponent />);
it('should display an empty state if an app annotation is missing', async () => {
const rendered = renderComponent();
const rendered = await renderComponent();
expect(await rendered.findByText('Missing Annotation')).toBeInTheDocument();
});