Files
redash/client/app/components/users/UserShow.test.js
Arik Fraimovich 56d3be2248 Prettier all the Javascript code & GitHub Action (#4433)
* Prettier all the JS files

* Add GitHub Action to autoformat code pushed to master

* Fix eslint violation due to formatting.

* Remove GitHub actions for styling

* Add restyled.io config
2019-12-11 17:05:38 +02:00

23 lines
559 B
JavaScript

import React from "react";
import renderer from "react-test-renderer";
import { Group } from "@/services/group";
import UserShow from "./UserShow";
beforeEach(() => {
Group.query = jest.fn(dataCallback => dataCallback([]));
});
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(<UserShow user={user} />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});