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

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

test('UserLink renders correctly', async () => {
    const 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>
    );
    await Promise.resolve();
    let tree = component.toJSON();
    expect(tree).toMatchSnapshot();
});