chore: remove visual UI tests that are caught by snapshots

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-03-12 11:12:06 +01:00
parent a89dfedbdd
commit 31fd1bc4e2
@@ -17,7 +17,6 @@
import { render } from '@testing-library/react';
import React from 'react';
import { Avatar } from './Avatar';
import { stringToColor } from './utils';
describe('<Avatar />', () => {
it('renders without exploding', async () => {
@@ -25,26 +24,4 @@ describe('<Avatar />', () => {
expect(getByText('JD')).toBeInTheDocument();
});
it('generates a background color', async () => {
const bgcolor = stringToColor('John Doe');
const { getByText } = render(<Avatar displayName="John Doe" />);
expect(getByText('JD').parentElement).toHaveStyle(
`background-color: ${bgcolor}`,
);
});
it('does not generate a background color when a picture is given', async () => {
const bgcolor = stringToColor('John Doe');
const { getByAltText } = render(
<Avatar
displayName="John Doe"
picture="https://backstage.io/test/john-doe.png"
/>,
);
expect(getByAltText('John Doe')).not.toHaveStyle(
`background-color: ${bgcolor}`,
);
});
});