Dashboards testing: Update failing test (#104966)

fix: update dashboards test
This commit is contained in:
Alex Spencer
2025-05-05 15:58:45 -05:00
committed by GitHub
parent cab241fbb6
commit 44447c0ca0
@@ -108,12 +108,15 @@ describe('DashboardDatasource', () => {
});
it('Should not mutate field state in dataframe', () => {
jest.useFakeTimers();
const { observable } = setup({ refId: 'A', panelId: 1, withTransforms: true });
let rsp: DataQueryResponse | undefined;
const test = observable.subscribe({ next: (data) => (rsp = data) });
jest.runAllTimers();
// modifying series in dashboard DS should not affect the original dataframe
rsp!.data[0].fields[0].state = {
calcs: { sum: 3 },
@@ -123,6 +126,8 @@ describe('DashboardDatasource', () => {
observable.subscribe({ next: (data) => (rsp = data) });
jest.runAllTimers();
// on further emissions the result should be the unmodified original dataframe
expect(rsp!.data[0].fields[0].state).toEqual({});
});