Skip to content
Merged
Show file tree
Hide file tree
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 @@ -58,6 +58,10 @@ describe("Import Controller", () => {
controller = context.module.get<ImportController>(ImportController);
});

beforeEach(() => {
jest.clearAllMocks();
});

afterAll(async () => {
await AppTestHelper.tearDownTestApp(context);
});
Expand All @@ -75,6 +79,8 @@ describe("Import Controller", () => {

const expectedLog: AppLog = {
userId: authInfo.id,
structureId: authInfo.structureId,
role: authInfo.role,
context: expectedLogContextEntree,
action: "IMPORT_USAGERS_FAILED",
};
Expand Down Expand Up @@ -117,6 +123,8 @@ describe("Import Controller", () => {
nombreTotal: 0,
},
userId: authInfo.id,
structureId: authInfo.structureId,
role: authInfo.role,
});
expect(response.status).toBe(HttpStatus.OK);
expect(JSON.parse(response.text)).toEqual({
Expand Down Expand Up @@ -150,6 +158,8 @@ describe("Import Controller", () => {
nombreTotal: 0,
},
userId: authInfo.id,
structureId: authInfo.structureId,
role: authInfo.role,
});
expect(response.status).toBe(HttpStatus.OK);
expect(JSON.parse(response.text)).toEqual({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ export class ImportController {
await this.appLogsService.create<FailedUsagerImportLogContext>({
action: "IMPORT_USAGERS_FAILED",
userId: user.id,
structureId: user.structureId,
role: user.role,
context: {
nombreActifs: extractUsagersNumber(usagersRows),
nombreErreurs: importErrors.length,
Expand Down Expand Up @@ -250,6 +252,8 @@ export class ImportController {
await this.appLogsService.create<SuccessfulUsagerImportLogContext>({
action: "IMPORT_USAGERS_SUCCESS",
userId: user.id,
role: user.role,
structureId: user.structureId,
context: {
nombreActifs: extractUsagersNumber(usagersRows),
nombreTotal: importPreviewRows.length,
Expand Down Expand Up @@ -294,6 +298,8 @@ export class ImportController {
await this.appLogsService.create<SuccessfulUsagerImportLogContext>({
action: "IMPORT_USAGERS_SUCCESS",
userId: user.id,
structureId: user.structureId,
role: user.role,
context: {
nombreActifs: extractUsagersNumber(usagersRows),
nombreTotal: importPreviewRows.length,
Expand Down
Loading