Annotations: Support filtering the target panels (#66325)

Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
This commit is contained in:
Ryan McKinley
2023-04-18 13:39:30 -07:00
committed by GitHub
parent a384194e15
commit 9452c0d718
32 changed files with 1042 additions and 235 deletions

View File

@@ -74,23 +74,11 @@ describe('AnnotationsSettings', () => {
});
beforeEach(() => {
// we have a default build-in annotation
dashboard = createDashboardModelFixture({
id: 74,
version: 7,
annotations: {
list: [
{
builtIn: 1,
datasource: { uid: 'uid1', type: 'grafana' },
enable: true,
hide: true,
iconColor: 'rgba(0, 211, 255, 1)',
name: 'Annotations & Alerts',
type: 'dashboard',
showIn: 1,
},
],
},
annotations: {},
links: [],
});
});
@@ -99,7 +87,8 @@ describe('AnnotationsSettings', () => {
setup(dashboard);
expect(screen.queryByRole('grid')).toBeInTheDocument();
expect(screen.getByRole('row', { name: /annotations & alerts \(built\-in\) grafana/i })).toBeInTheDocument();
expect(screen.getByRole('row', { name: /annotations & alerts \(built-in\) -- grafana --/i })).toBeInTheDocument();
expect(
screen.getByTestId(selectors.components.CallToActionCard.buttonV2('Add annotation query'))
).toBeInTheDocument();
@@ -115,7 +104,7 @@ describe('AnnotationsSettings', () => {
).toBeInTheDocument();
});
test('it renders the annotation names or uid if annotation doesnt exist', async () => {
test('it renders the annotation names or uid if annotation does not exist', async () => {
dashboard.annotations.list = [
...dashboard.annotations.list,
{