From 8749f4fe4af614148938f14779a3211cfb5883bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sun, 8 May 2022 11:06:55 +0200 Subject: [PATCH] Add `does show copy link button when supplied a link` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- .../views/context_menus/MessageContextMenu-test.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/components/views/context_menus/MessageContextMenu-test.tsx b/test/components/views/context_menus/MessageContextMenu-test.tsx index cc81b2047787..7b9a9ea11c38 100644 --- a/test/components/views/context_menus/MessageContextMenu-test.tsx +++ b/test/components/views/context_menus/MessageContextMenu-test.tsx @@ -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> = { + 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(