Skip to content

Commit 2440398

Browse files
committed
fix client tests
1 parent 4e10d75 commit 2440398

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/webapp/app/communication/course-faq/course-faq.component.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,12 @@ describe('CourseFaqs', () => {
154154
expect(alertServiceStub).toHaveBeenCalledOnce();
155155
});
156156

157-
it('should call sortService when sortRows is called', () => {
158-
jest.spyOn(sortService, 'sortByProperty').mockReturnValue([]);
157+
it('should call sortService when sortFaqs is called', () => {
158+
courseFaqComponent.filteredFaqs = [faq1, faq2, faq3];
159+
const sortByFunctionSpy = jest.spyOn(sortService, 'sortByFunction').mockReturnValue([faq3, faq2, faq1]);
159160
courseFaqComponent.sortFaqs();
160-
expect(sortService.sortByProperty).toHaveBeenCalledOnce();
161+
expect(sortByFunctionSpy).toHaveBeenCalledOnce();
162+
expect(sortByFunctionSpy).toHaveBeenCalledWith([faq1, faq2, faq3], expect.any(Function), false);
161163
});
162164

163165
it('should scroll and focus on the faq element with given id', () => {

0 commit comments

Comments
 (0)