Browse Source

fix test for setDataSource

pull/6419/head
mohamedsalem401 2 years ago
parent
commit
80237cdeb9
  1. 10
      packages/core/test/specs/data_sources/model/data_collection/ComponentDataCollection.getters-setters.ts

10
packages/core/test/specs/data_sources/model/data_collection/ComponentDataCollection.getters-setters.ts

@ -224,16 +224,20 @@ describe('Collection component getters and setters', () => {
test('setDataSource should update the data source and reflect in children', () => { test('setDataSource should update the data source and reflect in children', () => {
dsm.add({ dsm.add({
id: 'new_data_source_id', id: 'new_data_source_id',
records: [{ id: 'user4', user: 'user4', firstName: 'Name4', age: '20' }], records: [
{ id: 'user4', user: 'user4', firstName: 'Name4', age: '20' },
{ id: 'user5', user: 'user5', firstName: 'Name5', age: '21' }
],
}); });
cmp.setDataSource({ cmp.setDataSource({
type: DataVariableType, type: DataVariableType,
path: 'new_data_source_id', path: 'new_data_source_id',
}); });
const children = cmp.components(); const children = cmp.components();
expect(children).toHaveLength(1); expect(children).toHaveLength(1);
expect(children.at(0).components().at(0).getAttributes()['dataUser']).toBe('user4'); expect(children.at(0).components().at(0).getAttributes()['dataUser']).toBe('user5');
}); });
test('setStartIndex with zero should include the first record', () => { test('setStartIndex with zero should include the first record', () => {

Loading…
Cancel
Save