Skip to content

Commit 236204f

Browse files
Copilotrenemadsen
andcommitted
Fix import path for UnitsService in units-otp-code test
- Changed import from 'src/app/common/services' to 'src/app/common/services/advanced' - Matches component's import path - Split beforeEach into two blocks (one with waitForAsync, one for component creation) - Matches pattern used by other working tests Note: This test still fails with NG0201 provider error. This appears to be a TestBed/inject() interaction issue that requires further investigation. Co-authored-by: renemadsen <[email protected]>
1 parent 3ef0df9 commit 236204f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

eform-client/src/app/modules/advanced/components/units/units-otp-code/units-otp-code.component.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { NO_ERRORS_SCHEMA } from '@angular/core';
33
import { UnitsOtpCodeComponent } from './units-otp-code.component';
4-
import { UnitsService } from 'src/app/common/services';
4+
import { UnitsService } from 'src/app/common/services/advanced';
55
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
66
import { of } from 'rxjs';
77
import { UnitDto, OperationDataResult } from 'src/app/common/models';
@@ -31,10 +31,13 @@ describe('UnitsOtpCodeComponent', () => {
3131
],
3232
schemas: [NO_ERRORS_SCHEMA]
3333
}).compileComponents();
34-
34+
}));
35+
36+
beforeEach(() => {
3537
fixture = TestBed.createComponent(UnitsOtpCodeComponent);
3638
component = fixture.componentInstance;
37-
}));
39+
// Don't call fixture.detectChanges() here
40+
});
3841

3942
it('should create', () => {
4043
expect(component).toBeTruthy();

0 commit comments

Comments
 (0)