-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EW-1060 fixed deep imports and add separate factories
- Loading branch information
Showing
14 changed files
with
92 additions
and
76 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
apps/server/src/modules/common-cartridge/common-cartridge-client/room-client/dto/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export { RoomBoardDto } from './room-board.dto'; | ||
export { BoardElementDto } from './board-element.dto'; | ||
export { BoardTaskDto } from './board-task.dto'; | ||
export { BoardTaskStatusDto } from './board-task-status.dto'; | ||
export { BoardLessonDto } from './board-lesson.dto'; | ||
export { BoardColumnBoardDto } from './board-column-board.dto'; |
2 changes: 1 addition & 1 deletion
2
...cartridge/common-cartridge-client/room-client/mapper/board-task-status-dto.mapper.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...mmon-cartridge/common-cartridge-client/room-client/mapper/board-task-status-dto.mapper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 1 addition & 5 deletions
6
...ules/common-cartridge/common-cartridge-client/room-client/mapper/room-board-dto.mapper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
apps/server/src/modules/common-cartridge/controller/dto/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export * from './common-cartridge.params'; | ||
export * from './common-cartridge.response'; | ||
export * from './course.query.params'; | ||
export * from './course-export.body.params'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apps/server/src/modules/common-cartridge/testing/link-element.factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { faker } from '@faker-js/faker'; | ||
import { BaseFactory } from '@shared/testing'; | ||
import { Factory } from 'fishery'; | ||
import { LinkElementContentDto } from '../common-cartridge-client/card-client/dto/link-element-content.dto'; | ||
import { LinkElementResponseDto } from '../common-cartridge-client/card-client/dto/link-element-response.dto'; | ||
import { ContentElementType } from '../common-cartridge-client/card-client/enums/content-element-type.enum'; | ||
|
||
export const linkElementContentFactory = Factory.define<LinkElementContentDto>(() => { | ||
return { | ||
url: faker.internet.url(), | ||
title: faker.lorem.word(), | ||
description: faker.lorem.sentence(), | ||
}; | ||
}); | ||
|
||
class LinkElementFactory extends BaseFactory<LinkElementResponseDto, Readonly<LinkElementResponseDto>> {} | ||
export const linkElementFactory = LinkElementFactory.define(LinkElementResponseDto, () => { | ||
return { | ||
id: faker.string.uuid(), | ||
type: ContentElementType.LINK, | ||
content: linkElementContentFactory.build(), | ||
timestamps: { | ||
lastUpdatedAt: faker.date.recent().toISOString(), | ||
createdAt: faker.date.recent().toISOString(), | ||
deletedAt: undefined, | ||
}, | ||
}; | ||
}); |
27 changes: 27 additions & 0 deletions
27
apps/server/src/modules/common-cartridge/testing/rich-text-element.factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { BaseFactory } from '@shared/testing'; | ||
import { faker } from '@faker-js/faker'; | ||
import { Factory } from 'fishery'; | ||
import { RichTextElementResponseDto } from '../common-cartridge-client/card-client/dto/rich-text-element-response.dto'; | ||
import { RichTextElementContentDto } from '../common-cartridge-client/card-client/dto/rich-text-element-content.dto'; | ||
import { ContentElementType } from '../common-cartridge-client/card-client/enums/content-element-type.enum'; | ||
|
||
export const richTextElementContentFactory = Factory.define<RichTextElementContentDto>(() => { | ||
return { | ||
text: faker.lorem.word(), | ||
inputFormat: 'plainText', | ||
}; | ||
}); | ||
|
||
class RichTextElement extends BaseFactory<RichTextElementResponseDto, Readonly<RichTextElementResponseDto>> {} | ||
export const richTextElementFactroy = RichTextElement.define(RichTextElementResponseDto, () => { | ||
return { | ||
id: faker.string.uuid(), | ||
type: ContentElementType.RICH_TEXT, | ||
content: richTextElementContentFactory.build(), | ||
timestamps: { | ||
lastUpdatedAt: faker.date.recent().toISOString(), | ||
createdAt: faker.date.recent().toISOString(), | ||
deletedAt: undefined, | ||
}, | ||
}; | ||
}); |