Files
redash/client/app/components/users/UserShow.test.js
Gabriel Dutra 6a75ac4a57 Migrate User Pages to React (#3506)
* Create React version for the EmailSettingsWarning

* Migrate the Create User Page

* Migrate UserProfile to React

* Add /users/me to the routes (Percy ftw)

* Fix UserShow test spec

* Remove Error Messages component

* Show invitation link if email server not setup (#3519)

* return invite link to client if e-mail server is not set up

* add a couple of tests to make sure invite links are only returned when neccessary

* show invite link when e-mail is not configured

* remove "an e-mail has been sent" when there's no e-mail configured

* return invite_url in re-invites as well. Also refactor to reuse the code.

* Use CreateUserDialog instead of Page

* Render invite link on Resend Invitation click

* Add email validation to DynamicForm

* Fix EmailWarning position + update user list with user creation success

* Fix console error on UserProfile

* Redirect from /users/new  + rename createUser -> showCreateUserDialog

* Use alert instead of toastr for user creation errors

* Remove logic from CreateUserDialog

* CR

* Use Promise.reject instead of throw to avoid console error
2019-03-04 18:26:51 -03:00

17 lines
416 B
JavaScript

import React from 'react';
import renderer from 'react-test-renderer';
import UserShow from './UserShow';
test('renders correctly', () => {
const user = {
id: 2,
name: 'John Doe',
email: 'john@doe.com',
profileImageUrl: 'http://www.images.com/llama.jpg',
};
const component = renderer.create(<UserShow user={user} />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});