From db165f8f05bc6ed93fe555c5cdf76fc989045e2b Mon Sep 17 00:00:00 2001 From: skrustev Date: Thu, 3 Apr 2025 10:29:06 +0300 Subject: [PATCH] tests(prograssBar): Fix tests for Circular and Linear Bars not clearing test bed. --- .../src/lib/progressbar/circularbar.component.spec.ts | 6 ++++++ .../src/lib/progressbar/linearbar.component.spec.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/projects/igniteui-angular/src/lib/progressbar/circularbar.component.spec.ts b/projects/igniteui-angular/src/lib/progressbar/circularbar.component.spec.ts index 61beaa2f377..f59318b868e 100644 --- a/projects/igniteui-angular/src/lib/progressbar/circularbar.component.spec.ts +++ b/projects/igniteui-angular/src/lib/progressbar/circularbar.component.spec.ts @@ -27,6 +27,12 @@ describe('IgxCircularProgressBarComponent', () => { circularBar = fixture.debugElement.nativeElement; }); + afterEach(() => { + // Remove elements manually from DOM, because CircularBar overrides the id the TestBed uses + fixture.elementRef.nativeElement.remove(); + fixture.destroy(); + }); + it('should initialize with default attributes', () => { expect(progress.cssClass).toBe('igx-circular-bar'); expect(progress.textVisibility).toBe(true); diff --git a/projects/igniteui-angular/src/lib/progressbar/linearbar.component.spec.ts b/projects/igniteui-angular/src/lib/progressbar/linearbar.component.spec.ts index 1397b5cbacd..583f1260ae9 100644 --- a/projects/igniteui-angular/src/lib/progressbar/linearbar.component.spec.ts +++ b/projects/igniteui-angular/src/lib/progressbar/linearbar.component.spec.ts @@ -20,6 +20,12 @@ describe('IgxLinearProgressBarComponent', () => { linearBar = fixture.debugElement.nativeElement; }); + afterEach(() => { + // Remove elements manually from DOM, because LinearBar overrides the id the TestBed uses + fixture.elementRef.nativeElement.remove(); + fixture.destroy(); + }); + it('should initialize with default attributes', () => { expect(progress.valueMin).toBe(0); expect(progress.cssClass).toBe('igx-linear-bar');