Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add-initial-test #12585

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { of } from 'rxjs';
import { of, Observable } from 'rxjs';
import SpyInstance = jest.SpyInstance;
import { CourseService } from '../../../services/course.service';
import { FeedbackSessionsService } from '../../../services/feedback-sessions.service';
Expand Down Expand Up @@ -429,4 +429,22 @@
expect(fixture).toMatchSnapshot();
});

it('should call copySingleSession when requestList contains only one item', () => {
const result = {
sessionToCopyRowIndex: 0,
newFeedbackSessionName: 'New feedback session',
copyToCourseList: [],
sessionToCopyCourseId: '1'

Check failure on line 437 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Missing trailing comma

Check failure on line 437 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

Missing trailing comma

Check failure on line 437 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Missing trailing comma

Check failure on line 437 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

Missing trailing comma
}

Check failure on line 438 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Missing semicolon

Check failure on line 438 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

Missing semicolon

Check failure on line 438 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Missing semicolon

Check failure on line 438 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

Missing semicolon
const mockRequest = of({} as FeedbackSession)

Check failure on line 439 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Missing semicolon

Check failure on line 439 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

Missing semicolon

Check failure on line 439 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Missing semicolon

Check failure on line 439 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

Missing semicolon
jest.spyOn(component, 'createSessionCopyRequestsFromRowModel').mockReturnValue([mockRequest]);
const copySingleSessionSpy = jest.spyOn(component, 'copySingleSession');

component.copySessionEventHandler(result);

expect(component.createSessionCopyRequestsFromRowModel).toHaveBeenCalled();
expect(copySingleSessionSpy).toHaveBeenCalledWith(expect.any(Observable), component.modifiedTimestampsModal);
expect(component.isCopyOtherSessionLoading).toBeFalsy()

Check failure on line 447 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Missing semicolon

Check failure on line 447 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

Missing semicolon

Check failure on line 447 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Missing semicolon

Check failure on line 447 in src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

Missing semicolon
});

});
Loading