Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Add does show copy link button when supplied a link
Browse files Browse the repository at this point in the history
Signed-off-by: Šimon Brandner <[email protected]>
  • Loading branch information
SimonBrandner committed May 8, 2022
1 parent d6e9795 commit 8749f4f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/components/views/context_menus/MessageContextMenu-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ describe('MessageContextMenu', () => {
const menu = createMessageContextMenu(eventContent);
expect(menu.find('div[aria-label="Forward"]')).toHaveLength(0);
});

it('does show copy link button when supplied a link', () => {
const eventContent = MessageEvent.from("hello");
const props: Partial<React.ComponentProps<typeof MessageContextMenu>> = {
link: "https://google.com/",
};
const menu = createMessageContextMenu(eventContent, props);
const copyLinkButton = menu.find('a[aria-label="Copy link"]').first();
expect(copyLinkButton).toBeDefined();
expect((copyLinkButton.getDOMNode() as HTMLAnchorElement)?.href).toBe(props.link);
});
});

function createMessageContextMenu(
Expand Down

0 comments on commit 8749f4f

Please sign in to comment.