mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DashboardDataSource: Fixes issue where sometimes untransformed data could be returned (#87433)
* DashboardDataSource: always return a result key * Update * Update
This commit is contained in:
parent
d13e175328
commit
e7c39f18be
@ -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 });
|
||||
|
||||
|
@ -76,6 +76,7 @@ export class DashboardDatasource extends DataSourceApi<DashboardQuery> {
|
||||
state: result.data.state,
|
||||
errors: result.data.errors,
|
||||
error: result.data.error,
|
||||
key: 'source-ds-provider',
|
||||
};
|
||||
}),
|
||||
finalize(cleanUp)
|
||||
|
Loading…
Reference in New Issue
Block a user