Chore: Convert KeyValuesTable to RTL (#51278)

* Convert KeyValuesTable to RTL

* Update data-testid

* Update data-testid

* Convert KeyValuesTable to RTL

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This commit is contained in:
Seyaji
2022-06-29 16:44:48 +01:00
committed by GitHub
parent 8053f770c1
commit 2473dc68f6
4 changed files with 53 additions and 69 deletions

View File

@@ -119,21 +119,21 @@ describe('TraceView', () => {
const firstSpan = screen.getAllByText('', { selector: 'div[data-testid="span-view"]' })[0];
await userEvent.click(firstSpan);
await userEvent.click(screen.getByText(/Process/));
table = screen.getByText('', { selector: 'div[data-test-id="KeyValueTable"]' });
table = screen.getByText('', { selector: 'div[data-testid="KeyValueTable"]' });
expect(table.innerHTML).toContain('client-uuid-1');
await userEvent.click(firstSpan);
const secondSpan = screen.getAllByText('', { selector: 'div[data-testid="span-view"]' })[1];
await userEvent.click(secondSpan);
await userEvent.click(screen.getByText(/Process/));
table = screen.getByText('', { selector: 'div[data-test-id="KeyValueTable"]' });
table = screen.getByText('', { selector: 'div[data-testid="KeyValueTable"]' });
expect(table.innerHTML).toContain('client-uuid-2');
await userEvent.click(secondSpan);
const thirdSpan = screen.getAllByText('', { selector: 'div[data-testid="span-view"]' })[2];
await userEvent.click(thirdSpan);
await userEvent.click(screen.getByText(/Process/));
table = screen.getByText('', { selector: 'div[data-test-id="KeyValueTable"]' });
table = screen.getByText('', { selector: 'div[data-testid="KeyValueTable"]' });
expect(table.innerHTML).toContain('client-uuid-3');
});