Skip to content

Commit 652aa4f

Browse files
committed
fix: wrap selectCcLicense beforeEach in fakeAsync to flush debounce timer on Node 18.x
1 parent dde9f21 commit 652aa4f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,12 @@ describe('SubmissionSectionCcLicensesComponent', () => {
210210

211211
const ccLicence = submissionCcLicenses[1];
212212

213-
beforeEach(() => {
213+
beforeEach(fakeAsync(() => {
214214
component.selectCcLicense(ccLicence);
215215
fixture.detectChanges();
216-
});
216+
tick(300); // Flush debounce timer so no real timer leaks into subsequent fakeAsync zones
217+
fixture.detectChanges();
218+
}));
217219

218220
it('should display the selected cc license', () => {
219221
expect(component.selectedCcLicense.name).toContain('test license name 2');

0 commit comments

Comments
 (0)