Skip to content

Commit

Permalink
fix unit test for users controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Junjiequan committed Sep 18, 2024
1 parent 0e73c70 commit f891727
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/users/users.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe("UsersController", () => {
const result = await controller.getSettings(mockRequest as Request, userId);

// Assert
expect(result?.externalSettings).toEqual(mockUserSettings);
expect(result).toEqual(mockUserSettings);
expect(result?.externalSettings?.filters).toBeDefined();
expect(
(result?.externalSettings?.filters as Record<string, unknown>).length,
Expand Down Expand Up @@ -108,7 +108,7 @@ describe("UsersController", () => {
const expectedResponse: UserSettings = {
...updatedSettings,
_id: userId,
userId: userId, // Ensure all required properties are included
userId: userId,
datasetCount: updatedSettings.datasetCount,
jobCount: updatedSettings.jobCount,
externalSettings: updatedSettings.externalSettings,
Expand All @@ -124,7 +124,7 @@ describe("UsersController", () => {
updatedSettings,
);

expect(result?.externalSettings).toEqual(updatedSettings);
expect(result).toEqual(expectedResponse);
expect(result?.externalSettings?.filters).toBeDefined();
expect(
(result?.externalSettings?.filters as Record<string, unknown[]>).length,
Expand Down

0 comments on commit f891727

Please sign in to comment.