feat(core): remove data-testid

This commit is contained in:
Remi
2020-11-16 16:18:50 +01:00
parent 538328e083
commit ba985b1357
4 changed files with 11 additions and 19 deletions
@@ -34,6 +34,6 @@ describe('<EmptyState />', () => {
rendered.getByText('Your plugin is missing an annotation'),
).toBeInTheDocument();
expect(rendered.getByLabelText('button')).toBeInTheDocument();
expect(rendered.getByTestId('missingAnnotation')).toBeInTheDocument();
expect(rendered.getByAltText('annotation is missing')).toBeInTheDocument();
});
});
@@ -20,30 +20,30 @@ import { EmptyStateImage } from './EmptyStateImage';
describe('<EmptyStateImage />', () => {
it('render EmptyStateImage component with missing field', async () => {
const rendered = await renderWithEffects(
const { getByAltText } = await renderWithEffects(
wrapInTestApp(<EmptyStateImage missing="field" />),
);
expect(rendered.getByTestId('missingAnnotation')).toBeInTheDocument();
expect(getByAltText('annotation is missing')).toBeInTheDocument();
});
it('render EmptyStateImage component with missing info', async () => {
const rendered = await renderWithEffects(
const { getByAltText } = await renderWithEffects(
wrapInTestApp(<EmptyStateImage missing="info" />),
);
expect(rendered.getByTestId('noInformation')).toBeInTheDocument();
expect(getByAltText('no Information')).toBeInTheDocument();
});
it('render EmptyStateImage component with missing content', async () => {
const rendered = await renderWithEffects(
const { getByAltText } = await renderWithEffects(
wrapInTestApp(<EmptyStateImage missing="content" />),
);
expect(rendered.getByTestId('createComponent')).toBeInTheDocument();
expect(getByAltText('create Component')).toBeInTheDocument();
});
it('render EmptyStateImage component with missing data', async () => {
const rendered = await renderWithEffects(
const { getByAltText } = await renderWithEffects(
wrapInTestApp(<EmptyStateImage missing="data" />),
);
expect(rendered.getByTestId('noBuild')).toBeInTheDocument();
expect(getByAltText('no Build')).toBeInTheDocument();
});
});
@@ -45,7 +45,6 @@ export const EmptyStateImage = ({ missing }: Props) => {
src={missingAnnotation}
className={classes.generalImg}
alt="annotation is missing"
data-testid="missingAnnotation"
/>
);
case 'info':
@@ -54,7 +53,6 @@ export const EmptyStateImage = ({ missing }: Props) => {
src={noInformation}
alt="no Information"
className={classes.generalImg}
data-testid="noInformation"
/>
);
case 'content':
@@ -63,17 +61,11 @@ export const EmptyStateImage = ({ missing }: Props) => {
src={createComponent}
alt="create Component"
className={classes.generalImg}
data-testid="createComponent"
/>
);
case 'data':
return (
<img
src={noBuild}
alt="no Build"
className={classes.generalImg}
data-testid="noBuild"
/>
<img src={noBuild} alt="no Build" className={classes.generalImg} />
);
default:
return null;
@@ -136,7 +136,7 @@ describe('<FeatureCalloutCircular />', () => {
() => UPDATED_BOUNDING_RECT,
);
// Trigger the window resize event.
// Trigger the window scroll event.
fireEvent(window, new Event('scroll'));
});