From 672b915e584d801fb35277266456f32c4a336306 Mon Sep 17 00:00:00 2001 From: Mykyta Maliarchuk <84377976+nikita-web-ua@users.noreply.github.com> Date: Thu, 23 May 2024 09:16:43 +0200 Subject: [PATCH] [ACS-7982] ACC - fix categories tree (#9715) --- .../src/lib/tree/components/tree.component.html | 13 ++++--------- .../src/lib/tree/components/tree.component.spec.ts | 5 +++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/content-services/src/lib/tree/components/tree.component.html b/lib/content-services/src/lib/tree/components/tree.component.html index eda109fb594..7d36d030018 100644 --- a/lib/content-services/src/lib/tree/components/tree.component.html +++ b/lib/content-services/src/lib/tree/components/tree.component.html @@ -17,7 +17,7 @@ *matTreeNodeDef="let node when isLoadMoreNode" matTreeNodePadding>
-
@@ -54,6 +51,7 @@
diff --git a/lib/content-services/src/lib/tree/components/tree.component.spec.ts b/lib/content-services/src/lib/tree/components/tree.component.spec.ts index 514b492aadc..f3447113cdf 100644 --- a/lib/content-services/src/lib/tree/components/tree.component.spec.ts +++ b/lib/content-services/src/lib/tree/components/tree.component.spec.ts @@ -58,7 +58,8 @@ describe('TreeComponent', () => { const getNodeSpinner = async (nodeId: string) => loader.getHarnessOrNull(MatProgressSpinnerHarness.with({ ancestor: composeNodeSelector(nodeId) })); - const getExpandCollapseBtn = (nodeId: string) => fixture.nativeElement.querySelector(`${composeNodeSelector(nodeId)} .adf-icon`); + const getExpandCollapseBtn = (nodeId: string) => + fixture.nativeElement.querySelector(`${composeNodeSelector(nodeId)} .adf-tree-expand-collapse-button`); const tickCheckbox = (index: number) => { const selector = `[data-automation-id="${index === 0 ? 'has-children-node-checkbox' : 'no-children-node-checkbox'}"]`; @@ -289,7 +290,7 @@ describe('TreeComponent', () => { component.refreshTree(); fixture.detectChanges(); spyOn(component.treeService, 'getSubNodes').and.returnValue(of({ pagination: {}, entries: Array.from(singleNode) })); - const loadMoreBtn = fixture.debugElement.query(By.css('.adf-tree-load-more-button adf-icon')).nativeElement; + const loadMoreBtn = fixture.debugElement.query(By.css('.adf-tree-load-more-button')).nativeElement; const appendSpy = spyOn(component.treeService, 'appendNodes').and.callThrough(); loadMoreBtn.dispatchEvent(new Event('click')); fixture.whenStable();