DashboardDataSource: Fixes issue where sometimes untransformed data could be returned (#87433)

* DashboardDataSource: always return a result key

* Update

* Update
This commit is contained in:
Torkel Ödegaard
2024-05-08 08:25:19 +02:00
committed by GitHub
parent d13e175328
commit e7c39f18be
2 changed files with 11 additions and 0 deletions

View File

@ -26,6 +26,16 @@ describe('DashboardDatasource', () => {
expect(rsp?.data[0].fields[0].values).toEqual([1, 2, 3]);
});
it('should always set response key', async () => {
const { observable } = setup({ refId: 'A', panelId: 1 });
let rsp: DataQueryResponse | undefined;
observable.subscribe({ next: (data) => (rsp = data) });
expect(rsp?.key).toEqual('source-ds-provider');
});
it('Can subscribe to panel data + transforms', async () => {
const { observable } = setup({ refId: 'A', panelId: 1, withTransforms: true });