Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/renderer/components/avatars/AvatarWithFallback.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { render, screen } from '@testing-library/react';
import { fireEvent, render, screen } from '@testing-library/react';

import { type Link, Size } from '../../types';
import {
Expand Down Expand Up @@ -47,8 +47,8 @@ describe('renderer/components/avatars/AvatarWithFallback.tsx', () => {
// Find the avatar element by its alt text
const avatar = screen.getByAltText('gitify-app') as HTMLImageElement;

// Simulate an error event on the image element
avatar.dispatchEvent(new Event('error'));
// Simulate image load error (wrapped in act via fireEvent)
fireEvent.error(avatar);

expect(screen.getByTestId('avatar')).toMatchSnapshot();
});
Expand All @@ -59,8 +59,8 @@ describe('renderer/components/avatars/AvatarWithFallback.tsx', () => {
// Find the avatar element by its alt text
const avatar = screen.getByAltText('gitify-app') as HTMLImageElement;

// Simulate an error event on the image element
avatar.dispatchEvent(new Event('error'));
// Simulate image load error (wrapped in act via fireEvent)
fireEvent.error(avatar);

expect(screen.getByTestId('avatar')).toMatchSnapshot();
});
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading