diff options
Diffstat (limited to 'vnext/src/ui/__tests__/UserLink.test.js')
-rw-r--r-- | vnext/src/ui/__tests__/UserLink.test.js | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/vnext/src/ui/__tests__/UserLink.test.js b/vnext/src/ui/__tests__/UserLink.test.js index 30c35928..6bb4da29 100644 --- a/vnext/src/ui/__tests__/UserLink.test.js +++ b/vnext/src/ui/__tests__/UserLink.test.js @@ -1,19 +1,21 @@ -import { MemoryRouter, Switch, Route } from 'react-router-dom'; +import { MemoryRouter } from 'react-router-dom'; import { UserLink } from '../UserInfo'; -import renderer from 'react-test-renderer'; +import renderer, { act } 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 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(); }); |