From 470c451b377def248bddc04fc571d94e68484405 Mon Sep 17 00:00:00 2001 From: mohamedsalem401 Date: Mon, 29 Sep 2025 14:14:19 +0300 Subject: [PATCH] Undo updating component with datacolection tests --- .../model/data_collection/ComponentDataCollection.ts | 4 ++-- .../ComponentDataCollectionWithDataVariable.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts b/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts index 902b9ad45..0362ef9d4 100644 --- a/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts +++ b/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts @@ -169,9 +169,9 @@ export default class ComponentDataCollection extends ComponentWithCollectionsSta private rebuildChildrenFromCollection() { const items = this.getDataSourceItems(); - const itemsCount = size(items); + const { totalItems } = this.resolveCollectionConfig(items); - if (itemsCount === this.components().length) { + if (totalItems === this.components().length) { this.onCollectionsStateMapUpdate(this.collectionsStateMap); return; } diff --git a/packages/core/test/specs/data_sources/model/data_collection/ComponentDataCollectionWithDataVariable.ts b/packages/core/test/specs/data_sources/model/data_collection/ComponentDataCollectionWithDataVariable.ts index fd8bcccf8..764667c76 100644 --- a/packages/core/test/specs/data_sources/model/data_collection/ComponentDataCollectionWithDataVariable.ts +++ b/packages/core/test/specs/data_sources/model/data_collection/ComponentDataCollectionWithDataVariable.ts @@ -255,19 +255,19 @@ describe('Collection variable components', () => { const component = components.models[0]; const firstChild = component.components().at(0); const firstGrandchild = firstChild.components().at(0); - const secondChild = () => component.components().at(1); - const secondGrandchild = () => secondChild().components().at(0); + const secondChild = component.components().at(1); + const secondGrandchild = secondChild.components().at(0); expect(firstGrandchild.getInnerHTML()).toBe('user1'); - expect(secondGrandchild().getInnerHTML()).toBe('user2'); + expect(secondGrandchild.getInnerHTML()).toBe('user2'); firstRecord.set('user', 'new_user1_value'); expect(firstGrandchild.getInnerHTML()).toBe('new_user1_value'); - expect(secondGrandchild().getInnerHTML()).toBe('user2'); + expect(secondGrandchild.getInnerHTML()).toBe('user2'); secondRecord.set('user', 'new_user2_value'); expect(firstGrandchild.getInnerHTML()).toBe('new_user1_value'); - expect(secondGrandchild().getInnerHTML()).toBe('new_user2_value'); + expect(secondGrandchild.getInnerHTML()).toBe('new_user2_value'); }); }); });