Skip to content

Commit

Permalink
Added tests for InstructorRequestForm for unified countries
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoSavalaML committed May 21, 2024
1 parent d9644b1 commit b9bc5d3
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,24 @@ describe('InstructorRequestFormComponent', () => {
expect(accountService.createAccountRequest).toHaveBeenCalledTimes(1);
expect(accountService.createAccountRequest).toHaveBeenCalledWith(expect.objectContaining(typicalCreateRequest));
});

it('should auto-unify country when applicable', () => {
jest.spyOn(accountService, 'createAccountRequest').mockReturnValue(
new Observable((subscriber) => { subscriber.next(); }));
const unitedStatesModel: InstructorRequestFormModel = {
...typicalModel,
country: 'US',
};
const unitedStatesCreateRequest: AccountCreateRequest = {
...typicalCreateRequest,
instructorInstitution: `${unitedStatesModel.institution}, USA`,
};
fillFormWith(unitedStatesModel);
component.onSubmit()

Check failure on line 130 in src/web/app/pages-static/request-page/instructor-request-form/instructor-request-form.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Missing semicolon

Check failure on line 130 in src/web/app/pages-static/request-page/instructor-request-form/instructor-request-form.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

Missing semicolon

expect(accountService.createAccountRequest).toHaveBeenCalledTimes(1);
expect(accountService.createAccountRequest).toHaveBeenCalledWith(expect.objectContaining(unitedStatesCreateRequest));

Check failure on line 133 in src/web/app/pages-static/request-page/instructor-request-form/instructor-request-form.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

This line has a length of 121. Maximum allowed is 120

Check failure on line 133 in src/web/app/pages-static/request-page/instructor-request-form/instructor-request-form.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

This line has a length of 121. Maximum allowed is 120

});

});

0 comments on commit b9bc5d3

Please sign in to comment.