Skip to content

Latest commit

 

History

History
119 lines (87 loc) · 3.34 KB

File metadata and controls

119 lines (87 loc) · 3.34 KB

Warehouse Manager API test plan

Document version 1.0.7

Introduction

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.

In Scope

The project's tests are unit and integration tests. Completed tests are noted with ✔, while the pending ones are noted with ⌛.

Unit tests

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 [✔]

Integration tests

Backend integration test(s)

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 [✔]

Auth logic integration test(s)

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 [✔]

Database integration test(s)

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 [✔]

Out of scope

The Warehouse Manager API is a backend project, therefore any tests referring to the frontend are excluded.

Assumptions

The backend implementation is ongoing. MongoDB is the database of choice.

Environments + Tools

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.