mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 11:44:26 -06:00
ReturnToPrevious: Improve tests (#83812)
This commit is contained in:
parent
9e12caebc7
commit
fa44aebeff
@ -59,11 +59,11 @@ describe('ReturnToPrevious', () => {
|
||||
/* The report is called 'grafana_return_to_previous_button_dismissed' but the action is 'clicked' */
|
||||
const mockReturn = mockCalls.filter((call) => call[0] === 'grafana_return_to_previous_button_dismissed');
|
||||
expect(mockReturn).toHaveLength(1);
|
||||
expect(mockReturn[0][1]).toEqual({ action: 'clicked', page: '/dashboards' });
|
||||
});
|
||||
|
||||
it('should trigger event once when clicking on the Close button', async () => {
|
||||
setup();
|
||||
|
||||
const closeBtn = await screen.findByRole('button', { name: 'Close' });
|
||||
expect(closeBtn).toBeInTheDocument();
|
||||
await userEvent.click(closeBtn);
|
||||
@ -71,5 +71,6 @@ describe('ReturnToPrevious', () => {
|
||||
/* The report is called 'grafana_return_to_previous_button_dismissed' but the action is 'dismissed' */
|
||||
const mockDismissed = mockCalls.filter((call) => call[0] === 'grafana_return_to_previous_button_dismissed');
|
||||
expect(mockDismissed).toHaveLength(1);
|
||||
expect(mockDismissed[0][1]).toEqual({ action: 'dismissed', page: '/dashboards' });
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user