Document version 1.0.7
The Warehouse Manager API test plan contains information on the tests that are designed to establish the proper functioning of the backend implementation of the Warehouse Manager API.
The project's tests are unit and integration tests. Completed tests are noted with ✔, while the pending ones are noted with ⌛.
Focus is placed on the validation rules of the Mongoose schemas. The tests involve the following directories and files:
└── src
├── models
│ ├── customer.model.js
│ ├── order.model.js
│ ├── product.model.js
│ ├── stock.model.js
│ └── user.model.js
└── resources
├── validationErrorMessages.js
└── validationRegExp.js
Tests are conducted per model:
- User model [✔] ,
- Customer model [✔],
- Product model [✔],
- Stock model [✔],
- Order model [✔]
The tests are meant to check the integration of backend directories and files. Focus is placed on the express-validator middleware and the responses generated by the controllers. It primarily involves the following directories and files:
└── src
├── controllers
│ ├── customer.controller.js
│ ├── product.controller.js
│ ├── stock.controller.js
│ └── user.controller.js
└── middleware
└── expressValidationRules.js
The tests are conducted per operation:
- User registration [✔],
- Customer addition [✔],
- Customer information update [✔],
- Customer deletion [✔],
- Product addition [✔],
- Product information update [✔],
- Product deletion [✔],
- Stock creation [✔],
- Stock information update [✔],
- Stock deletion [✔],
- Order addition [✔],
- Order deletion [✔]
The focus of these integration tests is the auth directory and its contained files:
└── src
└── auth
├── authController.js
├── authResponseMessages.js
└── authValidationRules.js
The tests are executed per login outcome. Separate tests are also included for web token verification:
- Successful user login [✔],
- Failed user login [✔]
- Web token verification [✔]
The integration between the backend (middleware + controllers) and the MongoDB database is the main theme for these tests. Since middleware and controller behavior has already been tested, focus will be placed on limited operations per collection.
- users collection:
- auth processing [✔]
- customers collection:
- customer processing [✔]
- products collection:
- product processing [✔]
- stocks collection:
- stock processing [✔]
- orders collection:
- order processing [✔]
The Warehouse Manager API is a backend project, therefore any tests referring to the frontend are excluded.
The backend implementation is ongoing. MongoDB is the database of choice.
The primary tool for unit testing is the Jest testing framework:
"jest": "^29.7.0",Jest may also be used for the smooth running of integration tests.