Skip to content

Commit

Permalink
EW-1007 renamed some methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Fshmit committed Sep 26, 2024
1 parent 061a6b0 commit 72893f4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ describe(CourseRoomsClientAdapter.name, () => {
expect(service).toBeDefined();
});

describe('getCourseRoomBoard', () => {
describe('when getCourseRoomBoard is called', () => {
describe('getRoomBoardByCourseId', () => {
describe('when getRoomBoardByCourseId is called', () => {
const setup = () => {
const roomId = faker.string.uuid();
const response = createMock<AxiosResponse<SingleColumnBoardResponse>>({
Expand All @@ -67,9 +67,9 @@ describe(CourseRoomsClientAdapter.name, () => {
return { roomId, response };
};

it('should return the structure of the course', async () => {
it('should return a room board with full contents', async () => {
const { roomId, response } = setup();
const result = await service.getRoomsByCourseId(roomId);
const result = await service.getRoomBoardByCourseId(roomId);

expect(result).toEqual(response.data);
});
Expand All @@ -91,7 +91,7 @@ describe(CourseRoomsClientAdapter.name, () => {
it('should throw an UnauthorizedException', async () => {
const { roomId, error, adapter } = setup();

await expect(adapter.getRoomsByCourseId(roomId)).rejects.toThrowError(error);
await expect(adapter.getRoomBoardByCourseId(roomId)).rejects.toThrowError(error);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { CourseRoomsApi, SingleColumnBoardResponse } from './room-api-client';
export class CourseRoomsClientAdapter {
constructor(private readonly courseRoomsApi: CourseRoomsApi, @Inject(REQUEST) private request: Request) {}

public async getRoomsByCourseId(roomId: string): Promise<SingleColumnBoardResponse> {
public async getRoomBoardByCourseId(roomId: string): Promise<SingleColumnBoardResponse> {
const options = this.createOptionParams();
const response = await this.courseRoomsApi.courseRoomsControllerGetRoomBoard(roomId, options);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class CommonCartridgeController {
}

@Get('export/:parentId/room')
public async exportCourseRooms(@Param() exportCourseParams: ExportCourseParams): Promise<SingleColumnBoardResponse> {
return this.commonCartridgeUC.exportCourseRooms(exportCourseParams.parentId);
public async exportRoomBoard(@Param() exportCourseParams: ExportCourseParams): Promise<SingleColumnBoardResponse> {
return this.commonCartridgeUC.exportRoomBoard(exportCourseParams.parentId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export class CommonCartridgeExportService {
return courseCommonCartridgeMetadata;
}

public async findCourseRooms(courseId: string): Promise<SingleColumnBoardResponse> {
const courseRooms = await this.courseRoomsClientAdapter.getRoomsByCourseId(courseId);
public async findRoomBoardByCourseId(courseId: string): Promise<SingleColumnBoardResponse> {
const courseRooms = await this.courseRoomsClientAdapter.getRoomBoardByCourseId(courseId);

return courseRooms;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export class CommonCartridgeUc {
return response;
}

public async exportCourseRooms(courseId: EntityId): Promise<SingleColumnBoardResponse> {
const response = await this.exportService.findCourseRooms(courseId);
public async exportRoomBoard(courseId: EntityId): Promise<SingleColumnBoardResponse> {
const response = await this.exportService.findRoomBoardByCourseId(courseId);

return response;
}
Expand Down

0 comments on commit 72893f4

Please sign in to comment.