Skip to content

Commit

Permalink
chore: remove button render tests, improve button visibility on dark …
Browse files Browse the repository at this point in the history
…backgrounds #2025
  • Loading branch information
marek-mihok authored and mturoci committed Sep 6, 2023
1 parent fecbc74 commit 9955eae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
8 changes: 0 additions & 8 deletions ui/src/copyable_text.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ describe('CopyableText.tsx', () => {
expect(getByTestId(name)).toHaveValue('B')
})

it('Shows copy to clipboard button', () => {
const { container } = render(<XCopyableText model={copyableTextProps} />)
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(<XCopyableText model={{ ...copyableTextProps, multiline: true }} />)
await new Promise(resolve => setTimeout(resolve, 500))
Expand Down
3 changes: 3 additions & 0 deletions ui/src/copyable_text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
9 changes: 0 additions & 9 deletions ui/src/markdown.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(<Markdown source={source} />)
await new Promise(resolve => setTimeout(resolve, 500))

const copyButton = container.querySelector('button')

expect(copyButton).not.toBeInTheDocument()
})
})

0 comments on commit 9955eae

Please sign in to comment.