|
|
|
@ -20,6 +20,7 @@ describe('test comparisons', () => { |
|
|
|
|
config: { |
|
|
|
|
decimals: 4, |
|
|
|
|
}, |
|
|
|
|
labels: { server: 'A' }, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}); |
|
|
|
@ -38,8 +39,25 @@ describe('test comparisons', () => { |
|
|
|
|
expect(compareArrayValues(null as any, [frameA], compareDataFrameStructures)).toBeFalsy(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('name change and field copy is not a structure change', () => { |
|
|
|
|
expect(compareDataFrameStructures(frameB, { ...frameB, name: 'AA' })).toBeTruthy(); |
|
|
|
|
it('name change should be a structure change', () => { |
|
|
|
|
expect(compareDataFrameStructures(frameB, { ...frameB, name: 'AA' })).toBeFalsy(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('label change should be a structure change', () => { |
|
|
|
|
const changedFrameB = { |
|
|
|
|
...frameB, |
|
|
|
|
fields: [ |
|
|
|
|
frameB.fields[0], |
|
|
|
|
{ |
|
|
|
|
...frameB.fields[1], |
|
|
|
|
labels: { server: 'B' }, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}; |
|
|
|
|
expect(compareDataFrameStructures(frameB, changedFrameB)).toBeFalsy(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('Field copy should not be a structure change', () => { |
|
|
|
|
expect(compareDataFrameStructures(frameB, { ...frameB, fields: [field0, field1] })).toBeTruthy(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|