Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / src / components / refresh-button / refresh-button.test.tsx
index fe7b609d230b27808306f366943022a7c7df6f7e..3a9292e6ff703c9130465c7578af6ef00b183c13 100644 (file)
@@ -2,11 +2,11 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from "react";
+import React from "react";
 import { Button } from "@material-ui/core";
 import { shallow, configure } from "enzyme";
-import * as Adapter from "enzyme-adapter-react-16";
-import { RefreshButton } from './refresh-button';
+import Adapter from "enzyme-adapter-react-16";
+import { LAST_REFRESH_TIMESTAMP, RefreshButton } from './refresh-button';
 
 configure({ adapter: new Adapter() });
 
@@ -31,6 +31,7 @@ describe('<RefreshButton />', () => {
     });
 
     it('should pass window location to router', () => {
+        expect(localStorage.getItem(LAST_REFRESH_TIMESTAMP)).toBeFalsy();
         // setup
         const wrapper = shallow(<RefreshButton {...props} />);
 
@@ -39,5 +40,6 @@ describe('<RefreshButton />', () => {
 
         // then
         expect(props.history.replace).toHaveBeenCalledWith('/');
+        expect(localStorage.getItem(LAST_REFRESH_TIMESTAMP)).not.toBeFalsy();
     });
 });