From 32d47ea61e2286e2309b77f8d2fed438c77d46f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Jamr=C3=B3z?= Date: Mon, 16 Aug 2021 15:03:40 +0200 Subject: [PATCH] Fix unit tests --- .../plugins/datasource/graphite/specs/store.test.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/public/app/plugins/datasource/graphite/specs/store.test.ts b/public/app/plugins/datasource/graphite/specs/store.test.ts index 0b361161b28..0cd76bdf718 100644 --- a/public/app/plugins/datasource/graphite/specs/store.test.ts +++ b/public/app/plugins/datasource/graphite/specs/store.test.ts @@ -39,9 +39,6 @@ describe('Graphite actions', async () => { getTagsAutoComplete: jest.fn().mockReturnValue(Promise.resolve([])), }, target: { target: 'aliasByNode(scaleToSeconds(test.prod.*,1),2)' }, - panelCtrl: { - refresh: jest.fn(), - }, } as any; beforeEach(async () => { @@ -138,7 +135,7 @@ describe('Graphite actions', async () => { }); it('should call refresh', () => { - expect(ctx.panelCtrl.refresh).toHaveBeenCalled(); + expect(ctx.state.refresh).toHaveBeenCalled(); }); }); @@ -288,8 +285,8 @@ describe('Graphite actions', async () => { expect(ctx.state.target.target).toBe('aliasByNode(scaleToSeconds(test.prod.*, 1), 2)'); }); - it('should call panelCtrl.refresh', () => { - expect(ctx.panelCtrl.refresh).toHaveBeenCalled(); + it('should call refresh', () => { + expect(ctx.state.refresh).toHaveBeenCalled(); }); }); @@ -332,7 +329,7 @@ describe('Graphite actions', async () => { }); it('should call refresh', () => { - expect(ctx.panelCtrl.refresh).toHaveBeenCalled(); + expect(ctx.state.refresh).toHaveBeenCalled(); }); });