1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from "react";
6 import { shallow, configure } from "enzyme";
7 import * as Adapter from "enzyme-adapter-react-16";
8 import * as CopyToClipboard from "react-copy-to-clipboard";
9 import { CurrentTokenDialogComponent } from "./current-token-dialog";
11 configure({ adapter: new Adapter() });
13 describe("<CurrentTokenDialog />", () => {
21 currentToken: "123123123123",
27 describe("copy to clipboard", () => {
29 wrapper = shallow(<CurrentTokenDialogComponent {...props} />);
32 it("should copy API TOKEN to the clipboard", () => {
34 wrapper.find(CopyToClipboard).props().onCopy();
37 expect(props.dispatch).toHaveBeenCalledWith({
41 message: "Token copied to clipboard",
43 type: "OPEN_SNACKBAR",