-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(clients-signature-collection): add tests #15125
Conversation
WalkthroughThe changes span several configurations and code updates within the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SignatureCollectionClientService
participant MedmaelalistarApi
participant MedmaelasofnunApi
User ->> SignatureCollectionClientService: createList()
SignatureCollectionClientService ->> MedmaelalistarApi: Call createList API
MedmaelalistarApi -->> SignatureCollectionClientService: API Response
SignatureCollectionClientService -->> User: List Created
User ->> SignatureCollectionClientService: signList()
SignatureCollectionClientService ->> MedmaelasofnunApi: Check Eligibility
MedmaelasofnunApi -->> SignatureCollectionClientService: Eligible/Not Eligible
alt Eligible
SignatureCollectionClientService ->> SignatureCollectionClientService: Add Signature
else Not Eligible
SignatureCollectionClientService -->> User: Not Eligible to Sign
end
User ->> SignatureCollectionClientService: getLists()
SignatureCollectionClientService ->> MedmaelalistarApi: Retrieve Lists
MedmaelalistarApi -->> SignatureCollectionClientService: Lists Data
SignatureCollectionClientService -->> User: Lists Data
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Datadog ReportAll test runs ✅ 7 Total Test Services: 0 Failed, 7 Passed Test Services
🔻 Code Coverage Decreases vs Default Branch (1)
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15125 +/- ##
==========================================
- Coverage 37.00% 36.99% -0.02%
==========================================
Files 6432 6428 -4
Lines 131151 130974 -177
Branches 37535 37485 -50
==========================================
- Hits 48535 48452 -83
+ Misses 82616 82522 -94
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 31 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, all major test cases covered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (5)
- libs/clients/signature-collection/jest.config.ts (1 hunks)
- libs/clients/signature-collection/project.json (1 hunks)
- libs/clients/signature-collection/src/lib/signature-collection.service.spec.ts (1 hunks)
- libs/clients/signature-collection/src/lib/signature-collection.service.ts (3 hunks)
- libs/clients/signature-collection/tsconfig.json (1 hunks)
Files skipped from review due to trivial changes (2)
- libs/clients/signature-collection/project.json
- libs/clients/signature-collection/tsconfig.json
Additional context used
Path-based instructions (3)
libs/clients/signature-collection/jest.config.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/clients/signature-collection/src/lib/signature-collection.service.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/clients/signature-collection/src/lib/signature-collection.service.spec.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
GitHub Check: linting (clients-signature-collection)
libs/clients/signature-collection/src/lib/signature-collection.service.ts
[warning] 13-13:
'CanCreateInput' is defined but never used. Allowed unused vars must match /^_[a-zA-Z0-9]*$/u
[warning] 25-25:
'filter' is defined but never used. Allowed unused vars must match /^_[a-zA-Z0-9]*$/u
Additional comments not posted (6)
libs/clients/signature-collection/jest.config.ts (3)
8-10
: The update to include.tsx
files in thetransform
configuration is appropriate for projects using JSX in TypeScript. This change ensures that both.ts
and.tsx
files are properly handled byts-jest
.
13-13
: Removing 'html' frommoduleFileExtensions
is a good practice if HTML files are not being imported directly in the tests. This helps keep the configuration clean and focused on relevant file types.
14-14
: Using<rootDir>
in thecoverageDirectory
path enhances portability and maintainability of the Jest configuration by resolving paths relative to the root directory of the project.libs/clients/signature-collection/src/lib/signature-collection.service.ts (1)
38-38
: Changing the access modifier ofgetApiWithAuth
fromprivate
to public is acceptable if there is a need for external access. Consider adding documentation to clarify its intended use and any potential security implications.libs/clients/signature-collection/src/lib/signature-collection.service.spec.ts (2)
1-67
: The structure and setup of the test file are correctly implemented following standard practices for unit testing in NestJS. Good use of@nestjs/testing
for module setup and dependency injection.
69-369
: The test cases are comprehensive and well-organized, covering a variety of scenarios and functionalities. Good use of mocking and assertions to ensure that each unit test is isolated and focused.
libs/clients/signature-collection/src/lib/signature-collection.service.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- libs/clients/signature-collection/src/lib/signature-collection.service.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- libs/clients/signature-collection/src/lib/signature-collection.service.ts
* first tests * update jest config * moar tests * remove unused import --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* first tests * update jest config * moar tests * remove unused import --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
...
Attach a link to issue if relevant
What
Specify what you're trying to achieve
Why
Specify why you need to achieve this
Screenshots / Gifs
Attach Screenshots / Gifs to help reviewers understand the scope of the pull request
Checklist:
Summary by CodeRabbit
Tests
.tsx
files and updated test coverage paths.Refactor
SignatureCollectionClientService
for better code accessibility.Chores