Skip to content

Commit dde9f21

Browse files
committed
fix: add fakeAsync/tick to CC license test for debounced getCcLicenseLink
1 parent c10eb31 commit dde9f21

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
@@ -236,11 +236,13 @@ describe('SubmissionSectionCcLicensesComponent', () => {
236236

237237
describe('when all options have a value selected', () => {
238238

239-
beforeEach(() => {
239+
beforeEach(fakeAsync(() => {
240240
component.selectOption(ccLicence, ccLicence.fields[0], ccLicence.fields[0].enums[1]);
241241
component.selectOption(ccLicence, ccLicence.fields[1], ccLicence.fields[1].enums[0]);
242242
fixture.detectChanges();
243-
});
243+
tick(300); // Wait for debounceTime(300) in ccLicenseLink$ pipeline
244+
fixture.detectChanges();
245+
}));
244246

245247
it('should call the submission cc licenses data service getCcLicenseLink method', () => {
246248
expect(submissionCcLicenseUrlDataService.getCcLicenseLink).toHaveBeenCalledWith(

0 commit comments

Comments
 (0)