Skip to content

Commit

Permalink
fix(front): fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Jan 27, 2025
1 parent e0b0dd9 commit 339d541
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class SearchUsagersController {
!search.searchString &&
!search?.echeance &&
!search?.entretien &&
typeof search?.referrerId !== undefined &&
typeof search?.referrerId !== "undefined" &&
!search?.lastInteractionDate
) {
query.take(100);
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/users/controllers/users.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ import { AppUserGuard, CanGetUserStructureGuard } from "../../auth/guards";
@ApiTags("users")
@UseGuards(AuthGuard("jwt"), AppUserGuard)
export class UsersController {
@AllowUserStructureRoles("responsable", "admin")
@ApiBearerAuth()
@ApiOperation({ summary: "Liste des utilisateurs" })
@AllowUserStructureRoles(...USER_STRUCTURE_ROLE_ALL)
@Get("")
public async getUsers(
@CurrentUser() user: UserStructureAuthenticated
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { TestBed } from "@angular/core/testing";

import { ManageUsersService } from "./manage-users.service";
import { CommonModule, APP_BASE_HREF } from "@angular/common";
import { HttpClientTestingModule } from "@angular/common/http/testing";
import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";

describe("ManageUsersService", () => {
let service: ManageUsersService;

beforeEach(() => {
TestBed.configureTestingModule({});
TestBed.configureTestingModule({
imports: [HttpClientTestingModule, CommonModule],
providers: [{ provide: APP_BASE_HREF, useValue: "/" }],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
});
service = TestBed.inject(ManageUsersService);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ describe("EtatCivilParentFormComponent", () => {
prenom: "AD PRENOM",
},
],
referrerId: null,
contactByPhone: true,
customRef: null,
dateNaissance: new Date("2022-08-03T21:59:59.999Z"),
Expand Down

0 comments on commit 339d541

Please sign in to comment.