From: Bill Erickson <berickxx@gmail.com>
Date: Tue, 22 Oct 2019 17:52:56 +0000 (-0400)
Subject: LP1830973 Angular 8 org family test spec repair
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=63f7c2448017a2c50ba95ed25bc0e5c89671d060;p=evergreen%2Fequinox.git

LP1830973 Angular 8 org family test spec repair

The test runner does not like that the test expectations are wrapped in
the fixture.whenStable promise.  It reports an error, since no
expectations occur in line with the test:

ERROR: 'Spec 'Component: OrgFamilySelect allows user to turn off
includeDescendants checkbox' has no expectations.'

As the whenStable checks do not appear to be necessary, simply removing
them resolves the issue and allows the tests to succeed.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
---

diff --git a/Open-ILS/src/eg2/src/app/share/org-family-select/org-family-select.component.spec.ts b/Open-ILS/src/eg2/src/app/share/org-family-select/org-family-select.component.spec.ts
index f93b386216..f389e7ad5e 100644
--- a/Open-ILS/src/eg2/src/app/share/org-family-select/org-family-select.component.spec.ts
+++ b/Open-ILS/src/eg2/src/app/share/org-family-select/org-family-select.component.spec.ts
@@ -64,51 +64,39 @@ describe('Component: OrgFamilySelect', () => {
 
 
     it('provides includeAncestors checkbox by default', () => {
-        fixture.whenStable().then(() => {
-            includeAncestors = fixture.debugElement.query(By.css('#family-test-include-ancestors'));
-            expect(includeAncestors.nativeElement).toBeTruthy();
-        });
+        includeAncestors = fixture.debugElement.query(By.css('#family-test-include-ancestors'));
+        expect(includeAncestors.nativeElement).toBeTruthy();
     });
 
     it('provides includeDescendants checkbox by default', () => {
-        fixture.whenStable().then(() => {
-            includeDescendants = fixture.debugElement.query(By.css('#family-test-include-descendants'));
-            expect(includeDescendants.nativeElement).toBeTruthy();
-        });
+        includeDescendants = fixture.debugElement.query(By.css('#family-test-include-descendants'));
+        expect(includeDescendants.nativeElement).toBeTruthy();
     });
 
     it('allows user to turn off includeAncestors checkbox', () => {
-        fixture.whenStable().then(() => {
-            component.hideAncestorSelector = true;
-            fixture.detectChanges();
-            includeAncestors = fixture.debugElement.query(By.css('#family-test-include-ancestors'));
-            expect(includeAncestors).toBeNull();
-        });
+        component.hideAncestorSelector = true;
+        fixture.detectChanges();
+        includeAncestors = fixture.debugElement.query(By.css('#family-test-include-ancestors'));
+        expect(includeAncestors).toBeNull();
     });
 
     it('allows user to turn off includeDescendants checkbox', () => {
-        fixture.whenStable().then(() => {
-            component.hideDescendantSelector = true;
-            fixture.detectChanges();
-            includeDescendants = fixture.debugElement.query(By.css('#family-test-include-descendants'));
-            expect(includeDescendants).toBeNull();
-        });
+        component.hideDescendantSelector = true;
+        fixture.detectChanges();
+        includeDescendants = fixture.debugElement.query(By.css('#family-test-include-descendants'));
+        expect(includeDescendants).toBeNull();
     });
 
     it('disables includeAncestors checkbox when root OU is chosen', () => {
-        fixture.whenStable().then(() => {
-            fixture.detectChanges();
-            includeAncestors = fixture.debugElement.query(By.css('#family-test-include-ancestors'));
-            expect(includeAncestors.nativeElement.disabled).toBe(true);
-        });
+        fixture.detectChanges();
+        includeAncestors = fixture.debugElement.query(By.css('#family-test-include-ancestors'));
+        expect(includeAncestors.nativeElement.disabled).toBe(true);
     });
 
     it('disables includeAncestors checkbox when OU has no children', () => {
-        fixture.whenStable().then(() => {
-            fixture.detectChanges();
-            includeDescendants = fixture.debugElement.query(By.css('#family-test-include-descendants'));
-            expect(includeDescendants.nativeElement.disabled).toBe(true);
-        });
+        fixture.detectChanges();
+        includeDescendants = fixture.debugElement.query(By.css('#family-test-include-descendants'));
+        expect(includeDescendants.nativeElement.disabled).toBe(true);
     });
 
 });