chore: remove visual UI tests that are caught by snapshots
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -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}`,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user