Skip to content
This repository was archived by the owner on Jun 10, 2026. It is now read-only.
This repository was archived by the owner on Jun 10, 2026. It is now read-only.

No unit tests exist for API and views #15

Description

@Aypak

Observed behavior

No unit tests exist for the neither the application's API nor views. This implies that testing needs to be done manually whenever a change is made, which can be both time consuming and prone to human error.

Suggested Solution

Create unit tests for all static pages on the portal, and API for endpoints that do not depend on the database.
Static pages include:

  • Home page
  • Index of topics
  • Grade 7 revision
  • Literacy tests
  • Numeracy tests
  • External evaluations
  • Coach dashboard

API endpoints that do not depend on the database include:

  • get_server_date

Requirements

  • The unit tests should basically test that the right content type and status code are returned from each of the concerned pages and endpoints.
  • The tests should be runnable via npm e.g npm test
  • A recommended approach is to use mocha, supertest and should

Future work

A test suite can be set up to bring up and tear down a database containing a known number of users, test_responses etc. This can then be used to unit test all of the other API endpoints.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions