Browse Source

Update props tests

pull/6351/head
mohamedsalem401 2 years ago
parent
commit
644c357340
  1. 15
      packages/core/test/specs/data_sources/dynamic_values/props.ts

15
packages/core/test/specs/data_sources/dynamic_values/props.ts

@ -70,18 +70,23 @@ describe('Component Dynamic Properties', () => {
};
dsm.add(dataSource);
const dataVariable = {
type: DataVariableType,
path: 'ds_id.id1.value',
defaultValue: 'default',
};
const cmp = cmpRoot.append({
tagName: 'div',
content: {
type: DataVariableType,
path: 'ds_id.id1.value',
defaultValue: 'default',
},
content: dataVariable,
})[0];
cmp.set('content', 'static-value');
dsm.get('ds_id').getRecord('id1')?.set('value', 'new-dynamic-value');
expect(cmp.get('content')).toBe('static-value');
// @ts-ignore
cmp.set({ content: dataVariable });
expect(cmp.get('content')).toBe('new-dynamic-value');
});
test('updating to a new dynamic value listens to the new dynamic value only', () => {

Loading…
Cancel
Save