diff --git a/src/dom_components/view/ComponentDataVariableView.ts b/src/dom_components/view/ComponentDataVariableView.ts index 8c5503790..0528d4e01 100644 --- a/src/dom_components/view/ComponentDataVariableView.ts +++ b/src/dom_components/view/ComponentDataVariableView.ts @@ -24,6 +24,7 @@ export default class ComponentDataVariableView extends ComponentView { expect(cmpVar.getEl()?.innerHTML).toBe('Name1'); }); - test.todo('component is properly updating on its property changes'); + test('component is properly updating on its default value change', () => { + const cmpVar = addDataVariable(); + cmpVar.set({ value: 'none' }); + expect(cmpVar.getEl()?.innerHTML).toBe('none'); + }); + + test('component is properly updating on its path change', () => { + const ds = addDataSource(); + const cmpVar = addDataVariable(); + const el = cmpVar.getEl()!; + cmpVar.set({ path: 'ds1.id2.name' }); + expect(el.innerHTML).toBe('Name2'); + cmpVar.set({ path: 'ds1[id3]name' }); + expect(el.innerHTML).toBe('Name3'); + + ds.getRecord('id3')?.set({ name: 'Name3-UP' }); + expect(el.innerHTML).toBe('Name3-UP'); + }); describe('DataSource changes', () => { test('component is properly updating on data source add', () => {