Skip to content
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

No unit tests exist for API and views #15

Open
Aypak opened this issue Nov 9, 2021 · 0 comments
Open

No unit tests exist for API and views #15

Aypak opened this issue Nov 9, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Aypak
Copy link
Contributor

Aypak commented Nov 9, 2021

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.

@Aypak Aypak added the good first issue Good for newcomers label Nov 9, 2021
@Aypak Aypak added enhancement New feature or request and removed good first issue Good for newcomers labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant