Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
asliayk committed Nov 12, 2024
1 parent e9dd86c commit 10df059
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,18 @@ describe('CourseUsersSelectorComponent', () => {
expect(userSelectorComponent.selectedUsers).toEqual([exampleUserPublicInfoDTO]);
expect(fixture.debugElement.query(By.css('.delete-user'))).toBeFalsy();
}));

it('should render profile picture for users in dropdown', fakeAsync(() => {
const user = generateExampleUserPublicInfoDTO({});
searchUsersSpy.mockReturnValue(of(new HttpResponse({ body: [user], status: 200 })));

changeInput(fixture.debugElement.nativeElement, 'test');
tick(1000);
fixture.detectChanges();

const profilePicture = fixture.debugElement.query(By.directive(MockComponent(ProfilePictureComponent)));
expect(profilePicture).not.toBeNull();
}));
});

function getNativeInput(element: HTMLElement): HTMLInputElement {
Expand Down

0 comments on commit 10df059

Please sign in to comment.