1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from "react";
6 import { Button } from "@material-ui/core";
7 import { shallow, configure } from "enzyme";
8 import Adapter from "enzyme-adapter-react-16";
9 import { RefreshButton } from './refresh-button';
11 configure({ adapter: new Adapter() });
13 describe('<RefreshButton />', () => {
25 it('should render without issues', () => {
27 const wrapper = shallow(<RefreshButton {...props} />);
30 expect(wrapper.html()).toContain('button');
33 it('should pass window location to router', () => {
35 const wrapper = shallow(<RefreshButton {...props} />);
38 wrapper.find(Button).simulate('click');
41 expect(props.history.replace).toHaveBeenCalledWith('/');