blob: da80abb01352a23d1e1e857040c332d922fcc19a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import React from 'react';
import LoginButton from '../LoginButton';
import { create, act } from 'react-test-renderer';
test('Login button and form are renders correctly', () => {
var button = null;
act(() => {
button = create(
<LoginButton title="Log in" onAuth={() => { }} />
);
});
let link = button.toJSON();
expect(link).toMatchSnapshot();
act(() => {
button.root.findByType('a').props.onClick();
});
let modal = button.toJSON();
expect(modal).toMatchSnapshot();
});
|