diff options
Diffstat (limited to 'vnext/src/components/__tests__/LoginButton.test.js')
-rw-r--r-- | vnext/src/components/__tests__/LoginButton.test.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/vnext/src/components/__tests__/LoginButton.test.js b/vnext/src/components/__tests__/LoginButton.test.js index be083c22..da80abb0 100644 --- a/vnext/src/components/__tests__/LoginButton.test.js +++ b/vnext/src/components/__tests__/LoginButton.test.js @@ -1,16 +1,21 @@ import React from 'react'; import LoginButton from '../LoginButton'; -import renderer from 'react-test-renderer'; +import { create, act } from 'react-test-renderer'; test('Login button and form are renders correctly', () => { - const button = renderer.create( - <LoginButton title="Log in" onAuth={() => {}} /> - ); + var button = null; + act(() => { + button = create( + <LoginButton title="Log in" onAuth={() => { }} /> + ); + }); let link = button.toJSON(); expect(link).toMatchSnapshot(); - button.root.instance.toggleModal(); + act(() => { + button.root.findByType('a').props.onClick(); + }); let modal = button.toJSON(); expect(modal).toMatchSnapshot(); }); |