chore: update react imports
Signed-off-by: Paul Schultz <pschultz@pobox.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
import { createDevApp } from '@backstage/dev-utils';
|
||||
import { {{ pluginVar }}, {{ extensionName }} } from '../src/plugin';
|
||||
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
import { ExampleComponent } from './ExampleComponent';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
import { Typography, Grid } from '@material-ui/core';
|
||||
import {
|
||||
InfoCard,
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { ExampleFetchComponent } from './ExampleFetchComponent';
|
||||
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import {
|
||||
Table,
|
||||
|
||||
+17
-18
@@ -1,18 +1,17 @@
|
||||
import React from 'react';
|
||||
import { screen } from '@testing-library/react';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { ExampleComponent } from './ExampleComponent';
|
||||
|
||||
describe('ExampleComponent', () => {
|
||||
it('should render', async () => {
|
||||
await renderInTestApp(<ExampleComponent />);
|
||||
|
||||
expect(screen.getByText('Hello World')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should display a custom message', async () => {
|
||||
await renderInTestApp(<ExampleComponent message="Hello Example" />);
|
||||
|
||||
expect(screen.getByText('Hello Example')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
import { screen } from '@testing-library/react';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { ExampleComponent } from './ExampleComponent';
|
||||
|
||||
describe('ExampleComponent', () => {
|
||||
it('should render', async () => {
|
||||
await renderInTestApp(<ExampleComponent />);
|
||||
|
||||
expect(screen.getByText('Hello World')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should display a custom message', async () => {
|
||||
await renderInTestApp(<ExampleComponent message="Hello Example" />);
|
||||
|
||||
expect(screen.getByText('Hello Example')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
+28
-29
@@ -1,29 +1,28 @@
|
||||
import React from 'react';
|
||||
import { Typography } from '@material-ui/core';
|
||||
|
||||
/**
|
||||
* Props for {@link ExampleComponent}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface ExampleComponentProps {
|
||||
message?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays an example.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* Longer descriptions should be put after the `@remarks` tag. That way the initial summary
|
||||
* will show up in the API docs overview section, while the longer description will only be
|
||||
* displayed on the page for the specific API.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export function ExampleComponent(props: ExampleComponentProps) {
|
||||
// By destructuring props here rather than in the signature the API docs will look nicer
|
||||
const { message = 'Hello World' } = props;
|
||||
|
||||
return <Typography variant="h1">{message}</Typography>;
|
||||
}
|
||||
import { Typography } from '@material-ui/core';
|
||||
|
||||
/**
|
||||
* Props for {@link ExampleComponent}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface ExampleComponentProps {
|
||||
message?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays an example.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* Longer descriptions should be put after the `@remarks` tag. That way the initial summary
|
||||
* will show up in the API docs overview section, while the longer description will only be
|
||||
* displayed on the page for the specific API.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export function ExampleComponent(props: ExampleComponentProps) {
|
||||
// By destructuring props here rather than in the signature the API docs will look nicer
|
||||
const { message = 'Hello World' } = props;
|
||||
|
||||
return <Typography variant="h1">{message}</Typography>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user