Files
talk/src/core/client/stream/containers/UserBoxContainer.spec.tsx
T
2018-09-06 00:07:14 +02:00

32 lines
900 B
TypeScript

import { shallow } from "enzyme";
import React from "react";
import { removeFragmentRefs } from "talk-framework/testHelpers";
import { PropTypesOf } from "talk-framework/types";
import { UserBoxContainer } from "./UserBoxContainer";
// Remove relay refs so we can stub the props.
const UserBoxContainerN = removeFragmentRefs(UserBoxContainer);
it("renders correctly", () => {
const props: PropTypesOf<typeof UserBoxContainerN> = {
local: {
authPopup: {
open: false,
focus: false,
view: "SIGN_IN",
},
},
me: null,
// tslint:disable-next-line:no-empty
showAuthPopup: async () => {},
// tslint:disable-next-line:no-empty
setAuthPopupState: async () => {},
// tslint:disable-next-line:no-empty
signOut: async () => {},
};
const wrapper = shallow(<UserBoxContainerN {...props} />);
expect(wrapper).toMatchSnapshot();
});