Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ describe('ClusterHeaderLogs', () => {
expect(refScrollSection?.current?.scroll).toHaveBeenCalledWith(0, refScrollSection?.current?.scrollHeight)
})

it('should render scroll controls without a gap', () => {
renderWithProviders(<ClusterHeaderLogs {...props} />)

expect(screen.getByTestId('scroll-up-button').parentElement).toHaveClass('gap-0')
expect(screen.getByTestId('scroll-down-button')).not.toHaveClass('mr-2')
})

it('should trigger download on click', async () => {
const { userEvent } = renderWithProviders(<ClusterHeaderLogs {...props} />)
const buttons = screen.getAllByRole('button')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,30 +95,32 @@ export function ClusterHeaderLogs({ cluster, clusterStatus, refScrollSection, da
Launch diagnostic for this error
</Button>
)}
<Button
data-testid="scroll-up-button"
className="rounded-br-none rounded-tr-none border-r-0"
type="button"
variant="outline"
color="neutral"
size="sm"
iconOnly
onClick={() => forcedScroll()}
>
<Icon iconName="arrow-up-to-line" />
</Button>
<Button
data-testid="scroll-down-button"
className="mr-2 rounded-bl-none rounded-tl-none"
variant="outline"
type="button"
color="neutral"
size="sm"
iconOnly
onClick={() => forcedScroll(true)}
>
<Icon iconName="arrow-down-to-line" />
</Button>
<div className="flex items-center gap-0">
<Button
data-testid="scroll-up-button"
className="rounded-br-none rounded-tr-none border-r-0"
type="button"
variant="outline"
color="neutral"
size="sm"
iconOnly
onClick={() => forcedScroll()}
>
<Icon iconName="arrow-up-to-line" />
</Button>
<Button
data-testid="scroll-down-button"
className="rounded-bl-none rounded-tl-none"
variant="outline"
type="button"
color="neutral"
size="sm"
iconOnly
onClick={() => forcedScroll(true)}
>
<Icon iconName="arrow-down-to-line" />
</Button>
</div>
<Button
type="button"
variant="outline"
Expand Down
Loading