mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Admin: Keeps expired api keys visible in table after delete (#31636)
* Admin: Keeps expired keys visible in table after delete * Chore: covers component in tests before refactor * Refactor: splitting up into smaller components * Chore: fixes a small issue with the validation * Chore: forgot to export type
This commit is contained in:
@@ -3,6 +3,8 @@ import '@testing-library/jest-dom';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { within } from '@testing-library/dom';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
|
||||
import { LinksSettings } from './LinksSettings';
|
||||
|
||||
describe('LinksSettings', () => {
|
||||
@@ -61,7 +63,9 @@ describe('LinksSettings', () => {
|
||||
render(<LinksSettings dashboard={linklessDashboard} />);
|
||||
|
||||
expect(screen.getByRole('heading', { name: 'Dashboard Links' })).toBeInTheDocument();
|
||||
expect(screen.getByLabelText('Call to action button Add Dashboard Link')).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByLabelText(selectors.components.CallToActionCard.button('Add Dashboard Link'))
|
||||
).toBeInTheDocument();
|
||||
expect(screen.queryByRole('table')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
@@ -72,7 +76,9 @@ describe('LinksSettings', () => {
|
||||
const tableBodyRows = within(screen.getAllByRole('rowgroup')[1]).getAllByRole('row');
|
||||
|
||||
expect(tableBodyRows.length).toBe(links.length);
|
||||
expect(screen.queryByLabelText('Call to action button Add Dashboard Link')).not.toBeInTheDocument();
|
||||
expect(
|
||||
screen.queryByLabelText(selectors.components.CallToActionCard.button('Add Dashboard Link'))
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('it rearranges the order of dashboard links', () => {
|
||||
|
||||
Reference in New Issue
Block a user