From 9955eaef2098d4637924c52c57476399905acb8a Mon Sep 17 00:00:00 2001 From: Marek Mihok Date: Wed, 30 Aug 2023 16:54:50 +0200 Subject: [PATCH] chore: remove button render tests, improve button visibility on dark backgrounds #2025 --- ui/src/copyable_text.test.tsx | 8 -------- ui/src/copyable_text.tsx | 3 +++ ui/src/markdown.test.tsx | 9 --------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/ui/src/copyable_text.test.tsx b/ui/src/copyable_text.test.tsx index 8042402431..db1e65c28a 100644 --- a/ui/src/copyable_text.test.tsx +++ b/ui/src/copyable_text.test.tsx @@ -35,14 +35,6 @@ describe('CopyableText.tsx', () => { expect(getByTestId(name)).toHaveValue('B') }) - it('Shows copy to clipboard button', () => { - const { container } = render() - const copyButton = container.querySelector('button') - - expect(copyButton).toBeInTheDocument() - expect(copyButton).toBeVisible() - }) - it('Shows copy to clipboard button on hover - multiline text', async () => { const { container } = render() await new Promise(resolve => setTimeout(resolve, 500)) diff --git a/ui/src/copyable_text.tsx b/ui/src/copyable_text.tsx index 2fe9a3dfdd..b160bc0147 100644 --- a/ui/src/copyable_text.tsx +++ b/ui/src/copyable_text.tsx @@ -26,6 +26,9 @@ const right: CORNER_OFFSET, width: BUTTON_WIDTH, height: BUTTON_HEIGHT, + outlineWidth: 1, + outlineStyle: 'solid', + outlineColor: cssVar('$white') }, copiedBtn: { background: cssVar('$green'), diff --git a/ui/src/markdown.test.tsx b/ui/src/markdown.test.tsx index 8420ed8383..66dd733e70 100644 --- a/ui/src/markdown.test.tsx +++ b/ui/src/markdown.test.tsx @@ -66,13 +66,4 @@ describe('Markdown.tsx', () => { userEvent.hover(textfield) expect(container.querySelector('button')).toBeVisible() }) - - it('Does not render copy to clipboard button - markdown without code block', async () => { - const { container } = render() - await new Promise(resolve => setTimeout(resolve, 500)) - - const copyButton = container.querySelector('button') - - expect(copyButton).not.toBeInTheDocument() - }) }) \ No newline at end of file