aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/__tests__/UserLink.test.js
blob: 6bb4da29124344f134da4630d0a90cfc69f6aefa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { MemoryRouter } from 'react-router-dom';

import { UserLink } from '../UserInfo';
import renderer, { act } from 'react-test-renderer';

test('UserLink renders correctly', async () => {
    let component = null;
    act(() => {
        component = renderer.create(
            <MemoryRouter>
                <>
                    <UserLink user={{ uid: 1, uname: 'ugnich', avatar: 'https://juick.com/i/a/1-deadbeef.png' }} />
                    <UserLink user={{ uid: 1, uname: 'ugnich', avatar: 'https://juick.com/i/a/1-deadbeef.png', uri: '' }} />
                    <UserLink user={{ uid: 0, uname: '', uri: 'https://example.com/u/test' }} />
                </>
            </MemoryRouter>
        );
    });
    let tree = component.toJSON();
    expect(tree).toMatchSnapshot();
});