LogListControls: make tooltip more obvious (#105138)

* LogListControls: make tooltip more obvious

* Update test
This commit is contained in:
Matias Chomicki
2025-05-08 20:30:19 +02:00
committed by GitHub
parent a5708105df
commit d5235f52c5
3 changed files with 8 additions and 8 deletions
@@ -32,7 +32,7 @@ describe('LogListControls', () => {
</LogListContextProvider>
);
expect(screen.getByLabelText('Scroll to bottom')).toBeInTheDocument();
expect(screen.getByLabelText('Oldest logs first')).toBeInTheDocument();
expect(screen.getByLabelText(/oldest logs first/)).toBeInTheDocument();
expect(screen.getByLabelText('Deduplication')).toBeInTheDocument();
expect(screen.getByLabelText('Display levels')).toBeInTheDocument();
expect(screen.getByLabelText('Show timestamps')).toBeInTheDocument();
@@ -68,7 +68,7 @@ describe('LogListControls', () => {
expect(screen.getByLabelText('Scroll to bottom')).toBeInTheDocument();
expect(screen.getByLabelText('Scroll to top')).toBeInTheDocument();
expect(screen.getByLabelText('Display levels')).toBeInTheDocument();
expect(screen.queryByLabelText('Oldest logs first')).not.toBeInTheDocument();
expect(screen.queryByLabelText(/oldest logs first/)).not.toBeInTheDocument();
expect(screen.queryByLabelText('Deduplication')).not.toBeInTheDocument();
expect(screen.queryByLabelText('Show timestamps')).not.toBeInTheDocument();
expect(screen.queryByLabelText('Wrap lines')).not.toBeInTheDocument();
@@ -83,7 +83,7 @@ describe('LogListControls', () => {
</LogListContextProvider>
);
expect(screen.getByLabelText('Scroll to bottom')).toBeInTheDocument();
expect(screen.getByLabelText('Oldest logs first')).toBeInTheDocument();
expect(screen.getByLabelText(/oldest logs first/)).toBeInTheDocument();
expect(screen.getByLabelText('Deduplication')).toBeInTheDocument();
expect(screen.getByLabelText('Display levels')).toBeInTheDocument();
expect(screen.getByLabelText('Show timestamps')).toBeInTheDocument();
@@ -132,7 +132,7 @@ describe('LogListControls', () => {
<LogListControls eventBus={new EventBusSrv()} />
</LogListContextProvider>
);
await userEvent.click(screen.getByLabelText('Oldest logs first'));
await userEvent.click(screen.getByLabelText(/oldest logs first/));
expect(onLogOptionsChange).toHaveBeenCalledTimes(1);
expect(onLogOptionsChange).toHaveBeenCalledWith('sortOrder', LogsSortOrder.Descending);
});
@@ -226,8 +226,8 @@ export const LogListControls = ({ eventBus, visualisationType = 'logs' }: Props)
onClick={onSortOrderClick}
tooltip={
sortOrder === LogsSortOrder.Descending
? t('logs.logs-controls.newest-first', 'Newest logs first')
: t('logs.logs-controls.oldest-first', 'Oldest logs first')
? t('logs.logs-controls.newest-first', 'Sorted by newest logs first - Click to show oldest first')
: t('logs.logs-controls.oldest-first', 'Sorted by oldest logs first - Click to show newest first')
}
size="lg"
/>
+2 -2
View File
@@ -6231,8 +6231,8 @@
"escape-newlines": "Fix incorrectly escaped newline and tab sequences in log lines",
"hide-timestamps": "Hide timestamps",
"hide-unique-labels": "Hide unique labels",
"newest-first": "Newest logs first",
"oldest-first": "Oldest logs first",
"newest-first": "Sorted by newest logs first - Click to show oldest first",
"oldest-first": "Sorted by oldest logs first - Click to show newest first",
"prettify-json": "Expand JSON logs",
"remove-escaping": "Remove escaping",
"scroll-bottom": "Scroll to bottom",