mirror of
https://github.com/getredash/redash.git
synced 2026-03-21 16:00:09 -04:00
* 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
23 lines
578 B
JavaScript
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();
|
|
});
|