|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
import { waitFor, within } from '@testing-library/react'; |
|
|
|
|
import { waitFor } from '@testing-library/react'; |
|
|
|
|
|
|
|
|
|
import { withinExplore } from './setup'; |
|
|
|
|
import { getAllByRoleInQueryHistoryTab, withinExplore } from './setup'; |
|
|
|
|
|
|
|
|
|
export const assertQueryHistoryExists = async (query: string, exploreId = 'left') => { |
|
|
|
|
const selector = withinExplore(exploreId); |
|
|
|
@ -49,10 +49,7 @@ export const assertQueryHistoryComment = async (expectedQueryComments: string[], |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export const assertQueryHistoryIsStarred = async (expectedStars: boolean[], exploreId = 'left') => { |
|
|
|
|
const selector = withinExplore(exploreId); |
|
|
|
|
// Test ID is used to avoid test timeouts reported in #70158, #59116 and #47635
|
|
|
|
|
const queriesContainer = selector.getByTestId('query-history-queries-tab'); |
|
|
|
|
const starButtons = within(queriesContainer).getAllByRole('button', { name: /Star query|Unstar query/ }); |
|
|
|
|
const starButtons = getAllByRoleInQueryHistoryTab(exploreId, 'button', /Star query|Unstar query/); |
|
|
|
|
|
|
|
|
|
await waitFor(() => |
|
|
|
|
expectedStars.forEach((starred, queryIndex) => { |
|
|
|
|