Files
redash/client/app/pages/users/components/ReadOnlyUserProfile.test.js
Levko Kravets 6f842ef94a Refactor User Profile page and add extension points to it (#4996)
* Move components specific to UserProfile page to corresponding folder

* Split UserProfile page into components

* Rename components, refine code a bit

* Add some extension points

* Fix margin
2020-06-25 12:03:19 +03:00

23 lines
578 B
JavaScript

import React from "react";
import renderer from "react-test-renderer";
import Group from "@/services/group";
import ReadOnlyUserProfile from "./ReadOnlyUserProfile";
beforeEach(() => {
Group.query = jest.fn().mockResolvedValue([]);
});
test("renders correctly", () => {
const user = {
id: 2,
name: "John Doe",
email: "john@doe.com",
groupIds: [],
profileImageUrl: "http://www.images.com/llama.jpg",
};
const component = renderer.create(<ReadOnlyUserProfile user={user} />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});