Fix unit tests

This commit is contained in:
Piotr Jamróz
2021-08-16 15:03:40 +02:00
parent 14192a2aa6
commit 32d47ea61e
@@ -39,9 +39,6 @@ describe('Graphite actions', async () => {
getTagsAutoComplete: jest.fn().mockReturnValue(Promise.resolve([])), getTagsAutoComplete: jest.fn().mockReturnValue(Promise.resolve([])),
}, },
target: { target: 'aliasByNode(scaleToSeconds(test.prod.*,1),2)' }, target: { target: 'aliasByNode(scaleToSeconds(test.prod.*,1),2)' },
panelCtrl: {
refresh: jest.fn(),
},
} as any; } as any;
beforeEach(async () => { beforeEach(async () => {
@@ -138,7 +135,7 @@ describe('Graphite actions', async () => {
}); });
it('should call refresh', () => { 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)'); expect(ctx.state.target.target).toBe('aliasByNode(scaleToSeconds(test.prod.*, 1), 2)');
}); });
it('should call panelCtrl.refresh', () => { it('should call refresh', () => {
expect(ctx.panelCtrl.refresh).toHaveBeenCalled(); expect(ctx.state.refresh).toHaveBeenCalled();
}); });
}); });
@@ -332,7 +329,7 @@ describe('Graphite actions', async () => {
}); });
it('should call refresh', () => { it('should call refresh', () => {
expect(ctx.panelCtrl.refresh).toHaveBeenCalled(); expect(ctx.state.refresh).toHaveBeenCalled();
}); });
}); });