Skip to content

Commit

Permalink
Update props tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedsalem401 committed Dec 27, 2024
1 parent e40b3f2 commit 644c357
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/core/test/specs/data_sources/dynamic_values/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 644c357

Please sign in to comment.