aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/__tests__/LoginButton.test.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-04-07 23:30:05 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:54 +0300
commitc869329d6e961a9758a4671b9a2f1872e909b1e4 (patch)
tree794c5fe4716bd16a9c686d0c11ad417010bf9839 /vnext/src/components/__tests__/LoginButton.test.js
parent84c84cb7cb7a95122ef59cfb2699c927c1ba95b8 (diff)
Fix tests and update snapshots
Diffstat (limited to 'vnext/src/components/__tests__/LoginButton.test.js')
-rw-r--r--vnext/src/components/__tests__/LoginButton.test.js15
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();
});