Fixes warnings in some tests (#2241)

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-07-31 17:29:00 +02:00 committed by GitHub
parent cf72077920
commit a802656478
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 25 deletions

View file

@ -7,6 +7,7 @@
import { UserAvatar } from './user-avatar'
import { render } from '@testing-library/react'
import type { UserInfo } from '../../../api/users/types'
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
describe('UserAvatar', () => {
const user: UserInfo = {
@ -14,6 +15,11 @@ describe('UserAvatar', () => {
displayName: 'Boaty McBoatFace',
photo: 'https://example.com/test.png'
}
beforeEach(async () => {
await mockI18n()
})
it('renders the user avatar correctly', () => {
const view = render(<UserAvatar user={user} />)
expect(view.container).toMatchSnapshot()