Skip to content

Conversation

surajmaity1
Copy link
Contributor

@surajmaity1 surajmaity1 commented Mar 22, 2025

Date: 22 Mar, 2025

Developer Name: Suraj Maity ( @surajmaity1 )


Issue Ticket Number

Description

This PR adds test cases for the PATCH /requests/:id API for acknowledging OOO requests to ensure its correctness and reliability. The tests cover the following scenarios:

  • Valid input for acknowledging OOO request.
  • Authentication and authorization checks.
  • Error handling for edge cases and unexpected failures.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Test Coverage

Screenshot 1 integration

image
image
midd

image

acknowledge test Coverage summary

Additional Notes

Copy link

coderabbitai bot commented Mar 22, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Summary by CodeRabbit

  • New Features

    • Introduced enhanced out-of-office request acknowledgment, allowing clearer feedback when processing approval or rejection actions.
  • Bug Fixes

    • Improved error handling to ensure users receive appropriate messages for unauthorized access, invalid request types, duplicate processing, or unexpected issues.

Walkthrough

The changes enhance the functionality and test coverage for out-of-office (OOO) requests. New constants for creating and acknowledging OOO requests were added to a fixture file. Integration tests now cover the PATCH /requests/:id endpoint for various error conditions and success scenarios during request acknowledgment. Additionally, unit tests have been expanded to verify the behavior of the OOO request validator and service functions under valid and invalid conditions.

Changes

File(s) Change Summary
test/fixtures/.../oooRequest.ts Added two new exported constants: createOooRequests3 (for creating an OOO request with preset properties) and acknowledgeOooRequest (to represent approval with a comment for emergency situations).
test/integration/requests.test.ts Introduced a new test suite for the PATCH /requests/:id endpoint, defining variables to manage request states and covering scenarios such as unauthorized access, feature not implemented, non-existent requests, and error cases.
test/unit/{middlewares/oooRequests.test.ts, services/oooRequest.test.ts} Added unit test suites: one for acknowledgeOOORequestsValidator to check request validity, and another for the OOO Request Service (including validateOOOAcknowledgeRequest and acknowledgeOOORequest) for handling both successful and exceptional cases.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API
    participant Validator
    participant Service

    Client->>API: PATCH /requests/{id} (acknowledge OOO request)
    API->>Validator: Run acknowledgeOOORequestsValidator
    alt Validation Success
        API->>Service: Process OOO request acknowledgment
        Service-->>API: Return success response
        API-->>Client: 200 OK (acknowledged)
    else Validation Failure
        API-->>Client: Error response (400/401/404/501)
    end
Loading

Poem

I'm a bunny hopping through the code,
With new tests shining on the road.
OOO requests now run so clear,
Each patch and validator brings cheer.
Hoppy carrots and joy abound,
In this patch of code, magic is found!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@surajmaity1 surajmaity1 force-pushed the feat/test-user-ooo-acknowledge branch from e37b3b0 to 80ef6f8 Compare March 23, 2025 09:37
@surajmaity1 surajmaity1 marked this pull request as ready for review March 23, 2025 10:39
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1d4b457 and 80ef6f8.

📒 Files selected for processing (4)
  • test/fixtures/oooRequest/oooRequest.ts (1 hunks)
  • test/integration/requests.test.ts (5 hunks)
  • test/unit/middlewares/oooRequests.test.ts (2 hunks)
  • test/unit/services/oooRequest.test.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
test/fixtures/oooRequest/oooRequest.ts (1)
Learnt from: surajmaity1
PR: Real-Dev-Squad/website-backend#2386
File: test/fixtures/oooRequest/oooRequest.ts:59-60
Timestamp: 2025-03-22T14:28:57.808Z
Learning: The `createOooRequests2` object in test/fixtures/oooRequest/oooRequest.ts still uses the old property names `message` and `state` (instead of `reason` and `status`) because it's specifically used in acknowledging OOO request tests. This naming inconsistency will be fixed by surajmaity1 in a dedicated PR for acknowledging OOO requests.
🧬 Code Definitions (4)
test/fixtures/oooRequest/oooRequest.ts (1)
constants/requests.ts (1)
  • REQUEST_STATE (1-5)
test/unit/middlewares/oooRequests.test.ts (1)
test/fixtures/oooRequest/oooRequest.ts (1)
  • acknowledgeOooRequest (142-145)
test/unit/services/oooRequest.test.ts (1)
test/fixtures/oooRequest/oooRequest.ts (1)
  • acknowledgeOooRequest (142-145)
test/integration/requests.test.ts (3)
test/fixtures/oooRequest/oooRequest.ts (2)
  • createOooRequests3 (133-140)
  • acknowledgeOooRequest (142-145)
models/requests.ts (2)
  • createRequest (13-30)
  • updateRequest (32-70)
constants/requests.ts (8)
  • REQUEST_STATE (1-5)
  • REQUEST_TYPE (13-19)
  • REQUEST_DOES_NOT_EXIST (42-42)
  • REQUEST_ALREADY_APPROVED (35-35)
  • REQUEST_ALREADY_REJECTED (36-36)
  • INVALID_REQUEST_TYPE (63-63)
  • REQUEST_APPROVED_SUCCESSFULLY (31-31)
  • REQUEST_REJECTED_SUCCESSFULLY (32-32)
🪛 ESLint
test/fixtures/oooRequest/oooRequest.ts

[error] 139-139: Insert ,

(prettier/prettier)


[error] 144-144: Insert ,

(prettier/prettier)


[error] 145-145: Insert

(prettier/prettier)

test/unit/services/oooRequest.test.ts

[error] 3-3: Replace ·INVALID_REQUEST_TYPE,·REQUEST_ALREADY_APPROVED,·REQUEST_ALREADY_REJECTED,·REQUEST_APPROVED_SUCCESSFULLY,·REQUEST_DOES_NOT_EXIST,·REQUEST_STATE,·REQUEST_TYPE· with ⏎··INVALID_REQUEST_TYPE,⏎··REQUEST_ALREADY_APPROVED,⏎··REQUEST_ALREADY_REJECTED,⏎··REQUEST_APPROVED_SUCCESSFULLY,⏎··REQUEST_DOES_NOT_EXIST,⏎··REQUEST_STATE,⏎··REQUEST_TYPE,⏎

(prettier/prettier)


[error] 14-14: Insert ·

(prettier/prettier)


[error] 15-16: Delete ⏎··

(prettier/prettier)


[error] 18-18: Delete ··

(prettier/prettier)


[error] 19-19: Replace ········ with ····

(prettier/prettier)


[error] 20-20: Replace ········ with ····

(prettier/prettier)


[error] 21-21: Delete ··

(prettier/prettier)


[error] 23-23: Replace ····describe("validateOOOAcknowledgeRequest",·function with ··describe("validateOOOAcknowledgeRequest",·function·

(prettier/prettier)


[error] 24-25: Delete ⏎····

(prettier/prettier)


[error] 26-26: Replace ········ with ····

(prettier/prettier)


[error] 28-28: Delete ····

(prettier/prettier)


[error] 29-29: Delete ······

(prettier/prettier)


[error] 30-30: Delete ········

(prettier/prettier)


[error] 31-31: Replace ················ with ········

(prettier/prettier)


[error] 32-32: Replace ················ with ········

(prettier/prettier)


[error] 33-33: Replace ············} with ······};

(prettier/prettier)


[error] 34-34: Replace ········ with ····

(prettier/prettier)


[error] 36-36: Replace ········it("should·return·INVALID_REQUEST_TYPE·if·request·type·is·not·OOO",·async·function with ····it("should·return·INVALID_REQUEST_TYPE·if·request·type·is·not·OOO",·async·function·

(prettier/prettier)


[error] 37-37: Replace ············testRequestData·=·{...testRequestData,·requestType:·"ONBOARDING" with ······testRequestData·=·{·...testRequestData,·requestType:·"ONBOARDING"·

(prettier/prettier)


[error] 38-38: Delete ······

(prettier/prettier)


[error] 39-39: Replace ················ with ········

(prettier/prettier)


[error] 40-40: Replace ···················· with ··········

(prettier/prettier)


[error] 41-41: Replace ···················· with ··········

(prettier/prettier)


[error] 42-42: Replace ···················· with ··········

(prettier/prettier)


[error] 43-43: Replace ················ with ········

(prettier/prettier)


[error] 44-44: Delete ······

(prettier/prettier)


[error] 45-45: Replace ················ with ········

(prettier/prettier)


[error] 46-46: Delete ········

(prettier/prettier)


[error] 47-47: Delete ········

(prettier/prettier)


[error] 48-48: Delete ······

(prettier/prettier)


[error] 49-49: Replace ········ with ····

(prettier/prettier)


[error] 51-51: Replace ········it("should·return·REQUEST_ALREADY_APPROVED·if·request·is·already·approved",·async·function with ····it("should·return·REQUEST_ALREADY_APPROVED·if·request·is·already·approved",·async·function·

(prettier/prettier)


[error] 52-52: Replace ············testRequestData·=·{...testRequestData,·requestStatus:·REQUEST_STATE.APPROVED with ······testRequestData·=·{·...testRequestData,·requestStatus:·REQUEST_STATE.APPROVED·

(prettier/prettier)


[error] 53-53: Replace ············ with ······

(prettier/prettier)


[error] 54-54: Replace ················ with ········

(prettier/prettier)


[error] 55-55: Delete ··········

(prettier/prettier)


[error] 56-56: Replace ···················· with ··········

(prettier/prettier)


[error] 57-57: Replace ···················· with ··········

(prettier/prettier)


[error] 58-58: Replace ················ with ········

(prettier/prettier)


[error] 59-59: Delete ······

(prettier/prettier)


[error] 60-60: Replace ················ with ········

(prettier/prettier)


[error] 61-61: Replace ················ with ········

(prettier/prettier)


[error] 62-62: Replace ················ with ········

(prettier/prettier)


[error] 63-63: Delete ······

(prettier/prettier)


[error] 64-64: Delete ····

(prettier/prettier)


[error] 66-66: Replace ········it("should·return·REQUEST_ALREADY_REJECTED·if·request·is·already·rejected",·async·function with ····it("should·return·REQUEST_ALREADY_REJECTED·if·request·is·already·rejected",·async·function·

(prettier/prettier)


[error] 67-67: Replace ············testRequestData·=·{...testRequestData,·requestStatus:·REQUEST_STATE.REJECTED with ······testRequestData·=·{·...testRequestData,·requestStatus:·REQUEST_STATE.REJECTED·

(prettier/prettier)


[error] 68-68: Replace ············ with ······

(prettier/prettier)


[error] 69-69: Delete ········

(prettier/prettier)


[error] 70-70: Replace ···················· with ··········

(prettier/prettier)


[error] 71-71: Replace ···················· with ··········

(prettier/prettier)


[error] 72-72: Replace ···················· with ··········

(prettier/prettier)


[error] 73-73: Delete ········

(prettier/prettier)


[error] 74-74: Replace ············ with ······

(prettier/prettier)


[error] 75-75: Delete ········

(prettier/prettier)


[error] 76-76: Replace ················ with ········

(prettier/prettier)


[error] 77-77: Delete ········

(prettier/prettier)


[error] 78-78: Replace ············ with ······

(prettier/prettier)


[error] 79-79: Delete ····

(prettier/prettier)


[error] 81-81: Replace ········it("should·return·undefined·when·all·validation·checks·passes",·async·function with ····it("should·return·undefined·when·all·validation·checks·passes",·async·function·

(prettier/prettier)


[error] 82-82: Delete ······

(prettier/prettier)


[error] 83-83: Replace ················ with ········

(prettier/prettier)


[error] 84-84: Replace ················ with ········

(prettier/prettier)


[error] 85-85: Replace ················testRequestData.requestStatus, with ········testRequestData.requestStatus

(prettier/prettier)


[error] 86-86: Replace ············ with ······

(prettier/prettier)


[error] 87-87: Replace ············ with ······

(prettier/prettier)


[error] 87-87: Expected an assignment or function call and instead saw an expression.

(no-unused-expressions)


[error] 88-88: Delete ····

(prettier/prettier)


[error] 90-90: Replace ········it("should·throw·error",·async·function with ····it("should·throw·error",·async·function·

(prettier/prettier)


[error] 91-91: Replace ············ with ······

(prettier/prettier)


[error] 92-92: Delete ······

(prettier/prettier)


[error] 94-94: Delete ······

(prettier/prettier)


[error] 95-95: Replace ················ with ········

(prettier/prettier)


[error] 96-96: Delete ··········

(prettier/prettier)


[error] 97-97: Replace ···················· with ··········

(prettier/prettier)


[error] 98-98: Replace ···················· with ··········

(prettier/prettier)


[error] 99-99: Replace ················ with ········

(prettier/prettier)


[error] 100-100: Delete ······

(prettier/prettier)


[error] 101-101: Replace ················ with ········

(prettier/prettier)


[error] 102-102: Replace ················ with ········

(prettier/prettier)


[error] 102-102: Expected an assignment or function call and instead saw an expression.

(no-unused-expressions)


[error] 103-103: Replace ············ with ······

(prettier/prettier)


[error] 104-104: Replace ········ with ····

(prettier/prettier)


[error] 105-105: Replace ···· with ··

(prettier/prettier)


[error] 107-107: Replace ····describe("acknowledgeOOORequest",·function with ··describe("acknowledgeOOORequest",·function·

(prettier/prettier)


[error] 108-109: Replace ⏎········ with ····

(prettier/prettier)


[error] 110-110: Delete ····

(prettier/prettier)


[error] 111-111: Delete ····

(prettier/prettier)


[error] 113-113: Delete ····

(prettier/prettier)


[error] 114-114: Replace ············ with ······

(prettier/prettier)


[error] 115-115: Delete ······

(prettier/prettier)


[error] 116-116: Delete ······

(prettier/prettier)


[error] 117-117: Replace ············ with ······

(prettier/prettier)


[error] 118-118: Replace ············ with ······

(prettier/prettier)


[error] 120-120: Delete ······

(prettier/prettier)


[error] 121-121: Replace ················ with ········

(prettier/prettier)


[error] 122-122: Delete ········

(prettier/prettier)


[error] 123-123: Replace ················ with ········

(prettier/prettier)


[error] 124-124: Delete ········

(prettier/prettier)


[error] 125-125: Replace ················ with ········

(prettier/prettier)


[error] 126-126: Replace ················ with ········

(prettier/prettier)


[error] 127-127: Replace ················ with ········

(prettier/prettier)


[error] 128-128: Replace ················ with ········

(prettier/prettier)


[error] 129-129: Replace ················lastModifiedBy:·null with ········lastModifiedBy:·null,

(prettier/prettier)


[error] 130-130: Replace ············ with ······

(prettier/prettier)


[error] 131-131: Replace ········ with ····

(prettier/prettier)


[error] 133-133: Replace ········ with ····

(prettier/prettier)


[error] 134-134: Delete ······

(prettier/prettier)


[error] 135-139: Replace ················await·acknowledgeOOORequest(⏎····················"11111111111111111111",⏎····················acknowledgeOooRequest,⏎····················testSuperUserId⏎················ with ········await·acknowledgeOOORequest("11111111111111111111",·acknowledgeOooRequest,·testSuperUserId

(prettier/prettier)


[error] 140-140: Replace ············ with ······

(prettier/prettier)


[error] 141-141: Delete ········

(prettier/prettier)


[error] 142-142: Replace ················ with ········

(prettier/prettier)


[error] 143-143: Delete ······

(prettier/prettier)


[error] 144-144: Replace ········ with ····

(prettier/prettier)


[error] 146-146: Replace ········it("should·acknowledge·OOO·request",·async·function with ····it("should·acknowledge·OOO·request",·async·function·

(prettier/prettier)


[error] 147-151: Replace ············const·response·=·await·acknowledgeOOORequest(⏎················validOOORequest.id,⏎················acknowledgeOooRequest,⏎················testSuperUserId⏎············ with ······const·response·=·await·acknowledgeOOORequest(validOOORequest.id,·acknowledgeOooRequest,·testSuperUserId

(prettier/prettier)


[error] 152-152: Delete ······

(prettier/prettier)


[error] 153-153: Replace ············ with ······

(prettier/prettier)


[error] 154-154: Replace ············ with ······

(prettier/prettier)


[error] 155-155: Delete ····

(prettier/prettier)


[error] 157-157: Replace ········it("should·throw·error",·async·function with ····it("should·throw·error",·async·function·

(prettier/prettier)


[error] 158-158: Replace ············ with ······

(prettier/prettier)


[error] 159-159: Delete ······

(prettier/prettier)


[error] 161-161: Delete ······

(prettier/prettier)


[error] 162-166: Replace ················await·acknowledgeOOORequest(⏎····················validOOORequest.id,⏎····················acknowledgeOooRequest,⏎····················testSuperUserId⏎················ with ········await·acknowledgeOOORequest(validOOORequest.id,·acknowledgeOooRequest,·testSuperUserId

(prettier/prettier)


[error] 167-167: Replace ············ with ······

(prettier/prettier)


[error] 168-168: Delete ········

(prettier/prettier)


[error] 169-169: Replace ················ with ········

(prettier/prettier)


[error] 169-169: Expected an assignment or function call and instead saw an expression.

(no-unused-expressions)


[error] 170-170: Delete ······

(prettier/prettier)


[error] 171-171: Delete ····

(prettier/prettier)


[error] 172-172: Delete ··

(prettier/prettier)

🔇 Additional comments (16)
test/unit/middlewares/oooRequests.test.ts (3)

6-8: LGTM: Added import for new validator function.

The import statement correctly includes the new acknowledgeOOORequestsValidator function.


9-9: LGTM: Updated imports to include required fixture.

The import statement correctly includes the acknowledgeOooRequest fixture needed for testing.


94-121: Well-structured test suite for acknowledgeOOORequestsValidator.

The test suite provides good coverage for the validator function:

  1. Validates that requests with type field are rejected
  2. Validates that requests with incorrect status are rejected
  3. Verifies successful validation for valid acknowledge requests

Each test case properly asserts the expected behavior of the validator function.

test/unit/services/oooRequest.test.ts (1)

1-13: LGTM: Well-structured test file setup.

The imports and initial setup look good, bringing in necessary dependencies and fixtures for testing the OOO request services.

🧰 Tools
🪛 ESLint

[error] 3-3: Replace ·INVALID_REQUEST_TYPE,·REQUEST_ALREADY_APPROVED,·REQUEST_ALREADY_REJECTED,·REQUEST_APPROVED_SUCCESSFULLY,·REQUEST_DOES_NOT_EXIST,·REQUEST_STATE,·REQUEST_TYPE· with ⏎··INVALID_REQUEST_TYPE,⏎··REQUEST_ALREADY_APPROVED,⏎··REQUEST_ALREADY_REJECTED,⏎··REQUEST_APPROVED_SUCCESSFULLY,⏎··REQUEST_DOES_NOT_EXIST,⏎··REQUEST_STATE,⏎··REQUEST_TYPE,⏎

(prettier/prettier)

test/integration/requests.test.ts (12)

3-20: LGTM: Updated imports with required modules and fixtures.

The imports have been properly updated to include the necessary modules, constants, and fixtures for the new tests, including:

  • sinon for mocking
  • UNAUTHORIZED_TO_ACKNOWLEDGE_OOO_REQUEST and INVALID_REQUEST_TYPE constants
  • acknowledgeOooRequest and createOooRequests3 fixtures
  • logUtils for testing error cases

49-49: LGTM: Added superuser ID variable.

The addition of testSuperUserId is necessary for testing authorization scenarios.


56-56: LGTM: Updated beforeEach to set superuser ID.

Setting the testSuperUserId to the returned value properly initializes the variable.


196-221: LGTM: Well-structured setup for PATCH endpoint tests.

The setup includes:

  • New variables for test data
  • Creation of different OOO requests with various states (pending, approved, rejected)
  • An invalid request type for testing type validation

Each variable is correctly initialized with appropriate test data.


223-234: LGTM: Authentication test for PATCH endpoint.

This test properly verifies that the endpoint returns a 401 status when a user is not logged in, which is an important security check.


236-250: LGTM: Feature flag test for PATCH endpoint.

This test verifies that the endpoint returns a 501 status when the dev flag is false, indicating that the feature is controlled by a feature flag.


252-266: LGTM: Validation test for non-existent requests.

This test confirms that the endpoint returns a 404 status when the request ID doesn't exist.


268-282: LGTM: Authorization test for PATCH endpoint.

This test verifies that the endpoint returns a 401 status when a user doesn't have super user permissions, which is an important security check.


284-314: LGTM: Request state validation tests.

These tests check that the endpoint properly validates the current state of the request:

  • Returns 400 if the request is already approved
  • Returns 400 if the request is already rejected

These validations prevent duplicate processing of requests.


316-330: LGTM: Request type validation test.

This test verifies that the endpoint returns a 400 status when attempting to acknowledge a non-OOO request type, ensuring type validation.


332-362: LGTM: Success case tests for approving and rejecting requests.

These tests verify that the endpoint correctly:

  • Approves OOO requests with 200 status
  • Rejects OOO requests with 200 status

Both tests confirm the expected success messages for their operations.


364-378: LGTM: Error handling test for unexpected errors.

This test uses sinon to create a failure condition and verifies that the endpoint returns a 500 status with appropriate error message, demonstrating robust error handling.

@surajmaity1 surajmaity1 force-pushed the feat/test-user-ooo-acknowledge branch from 80ef6f8 to b17187b Compare April 10, 2025 03:24
@prakashchoudhary07
Copy link
Contributor

@surajmaity1 Error in build it self, please have a look

@prakashchoudhary07
Copy link
Contributor

@surajmaity1 Build is faling, please check

@surajmaity1
Copy link
Contributor Author

@surajmaity1 Build is faling, please check

Hi @prakashchoudhary07 , it's fixed.
Thank you.

@surajmaity1
Copy link
Contributor Author

@surajmaity1 Error in build it self, please have a look

Hi @prakashchoudhary07 , it's fixed now.
Thank you.

@surajmaity1 surajmaity1 force-pushed the feat/test-user-ooo-acknowledge branch from 854f1c8 to 1f545e6 Compare May 2, 2025 12:38
@surajmaity1 surajmaity1 force-pushed the feat/test-user-ooo-acknowledge branch from 1f545e6 to acc56ec Compare May 2, 2025 12:52
@prakashchoudhary07 prakashchoudhary07 merged commit cd928e2 into Real-Dev-Squad:develop May 2, 2025
4 checks passed
@pankajjs pankajjs mentioned this pull request May 7, 2025
10 tasks
@coderabbitai coderabbitai bot mentioned this pull request May 13, 2025
10 tasks
pankajjs pushed a commit that referenced this pull request Jun 1, 2025
…O requests (#2391)

* feat: add tests for PATCH OOO request

* feat: add tests for PATCH OOO request

* fix: skip test cases

* fix: test case

* fix: test skipped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants