Logo Executive is your partner in logo exploration. Our platform boasts a collection of APIs designed to simplify the process of obtaining company logos.
Test cases for the Subscription services on the server-side. These test cases will evaluate the following functions:
Function Overview of Admin Service:
1 createSubscription
This function is responsible for creating a new subscription for a user
2 fetchSubscriptionByuserid
This function retrieves the subscription details of a user based on their userId
I have written test cases for the Subscription service to make a subscription. The test cases I wrote are:
1 createSubscription
Create Subscription It will try to create a subscription and return the instance Of Subscription on Success
Firestore Operation Fails: Verifies that the function throws an error if there is a failure in the Firestore operation.
2 fetchSubscriptionByuserid
Fetch Subscription By userId It will return the instance Of Subscription if it exists for the user
Fetch Subscription By userId Return null if subscription does not exist for that user
Firestore Operation Fails: Verifies that the function throws an error if there is a failure in the Firestore operation.
How to Test the Changes
Navigate to the root directory.
Run the command:
yarn test:server
Screenshots or Recordings
Checklist
[x] I have tested the changes locally and they work as expected.
[x] I have added/updated tests that cover the changes.
[ ] I have updated the documentation to reflect the changes.
[x] This pull request follows the project's coding guidelines.
Description
Test cases for the Subscription services on the server-side. These test cases will evaluate the following functions:
Function Overview of Admin Service: 1
createSubscription
This function is responsible for creating a new subscription for a user 2
fetchSubscriptionByuserid
This function retrieves the subscription details of a user based on their userId I have written test cases for the Subscription service to make a subscription. The test cases I wrote are: 1
createSubscription
Create Subscription
It will try to create a subscription and return the instance Of Subscription on SuccessFirestore Operation Fails
: Verifies that the function throws an error if there is a failure in the Firestore operation.2
fetchSubscriptionByuserid
Fetch Subscription By userId
It will return the instance Of Subscription if it exists for the userFetch Subscription By userId
Return null if subscription does not exist for that userFirestore Operation Fails
: Verifies that the function throws an error if there is a failure in the Firestore operation.How to Test the Changes
Screenshots or Recordings
Checklist