Skip to content

Commit

Permalink
change variable name in client tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edkaya committed Oct 11, 2024
1 parent f9e24ea commit 4017d0e
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ describe('CourseArchiveComponent', () => {

component.ngOnInit();

expect(component.coursesDTO).toEqual(courses);
expect(component.coursesDTO).toHaveLength(7);
expect(component.courses).toEqual(courses);
expect(component.courses).toHaveLength(7);
});

it('should handle an empty response body correctly when fetching all courses for archive', () => {
Expand All @@ -99,7 +99,7 @@ describe('CourseArchiveComponent', () => {

expect(getCoursesForArchiveSpy).toHaveBeenCalledOnce();
req.flush(null);
expect(component.coursesDTO).toStrictEqual(emptyCourses);
expect(component.courses).toStrictEqual(emptyCourses);
});

it('should sort the name of the semesters uniquely', () => {
Expand Down Expand Up @@ -205,8 +205,8 @@ describe('CourseArchiveComponent', () => {

expect(getCoursesForArchiveSpy).toHaveBeenCalledOnce();
expect(mapCoursesIntoSemestersSpy).toHaveBeenCalledOnce();
expect(component.coursesDTO).toBeDefined();
expect(component.coursesDTO).toHaveLength(7);
expect(component.courses).toBeDefined();
expect(component.courses).toHaveLength(7);

const onSortSpy = jest.spyOn(component, 'onSort');
const button = fixture.debugElement.nativeElement.querySelector('#sort-test');
Expand All @@ -223,7 +223,7 @@ describe('CourseArchiveComponent', () => {
expect(component.semesters[1]).toBe('WS21/22');
expect(component.semesters[0]).toBe('SS19');

const iconComponent = fixture.debugElement.query(By.css('#icon-test-up')).componentInstance;
const iconComponent = fixture.debugElement.query(By.css('#icon-test-down')).componentInstance;

expect(iconComponent).not.toBeNull();
expect(iconComponent.icon).toBe(component.faArrowUp19);
Expand Down

0 comments on commit 4017d0e

Please sign in to comment.