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

Tests #279

Open
rugulous opened this issue Feb 12, 2023 · 3 comments
Open

Tests #279

rugulous opened this issue Feb 12, 2023 · 3 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed new feature question Further information is requested

Comments

@rugulous
Copy link
Member

We should probably add some form of automated testing now that we have an action runner.

I think running them before each commit is too restrictive and it's the purpose of pull requests to ensure that only working code makes it live - so I think passing tests should be a prerequisite of merging PRs.

This issue is a discussion/suggestion ticket as this issue is so large - any agreed on tests should be done in separate issues!

@rugulous rugulous added enhancement New feature or request documentation Improvements or additions to documentation help wanted Extra attention is needed question Further information is requested new feature labels Feb 12, 2023
@rugulous
Copy link
Member Author

I think a good first step would actually be testing all the helper methods in Library.

The Helpers are all pure functions so are easy to test

We can hook the models up to a dummy database (created before first test, dropped after last test) and fill with dummy data so we know what the queries should be returning

@matt-fidd
Copy link
Member

Seems fair enough to me

@rugulous
Copy link
Member Author

rugulous commented Feb 17, 2023

Seeing as I've broken everything and touched e v e r y s i n g l e f i l e for this change I'm working on, I'm seeing the importance of these tests more and more >.<

I'm going to try and put a list of every action possible through the system here so that we can build tests based off them

DB/System stuff

  • Do all the models sync?
  • Do all the Seeds import correctly?
    • Do the standalone Seeds import?
    • Do the Seeds with includes import?

"Core" stuff

  • Am I stopped from logging in if I supply incorrect details?
  • Can I log in with the correct details?
  • If I need to reset my password, can I bypass the password reset screen?
  • Are the Admin Stats on the home screen correct?

Config

  • Can I add a Membership Type?
  • Can I update existing Membership Types?
  • Can I add an Event Type?
  • Can I update existing Event Types?
  • Can I add discounts to an Event Type?
  • Can I add a Payment Type?
  • Can I update existing Payment Types?
  • Can I add a Division?
  • Can I update existing Divisions?
  • Can I add a Caption?
  • Can I update existing Captions?
  • Can I add a Season
  • Can I update existing Seasons?

Users

  • Can I add a user?
  • Can I update a user?
  • Can I change someone else's password?
  • Can I add a caption to a user?
  • Can I remove a caption from a user?
  • If I set a user as inactive, do they show in the right place?

Membership

  • Can I save import config details?
  • Does the import bring in the right bands/memberships?
  • Can I update the Division of a Membership?
  • Can I add a new membership?
  • Can I mark a membership as paid?
  • Can I add a label to a membership?
  • Can I remove a label from a membership?
  • Can I create a new label?

Organisation

  • Can I add a new organisation whilst logged in (add to existing account)
  • Can I add a new organisation without an account (create new account)?
  • Can I add an address to an organisation?
  • Can I update an organisation's address?
  • Can I update an organisation's details?
  • Can I remove a contact from an organisation?
  • Can I add an existing contact to an organisation?
  • Can I add a new contact to an organisation?

Events

  • Can I add a new event?
  • Can I update event details?
  • Can I update event registration details?
  • Can I use the default captions on an event?
  • Can I add captions to an event?
  • Can I remove captions from an event?
  • Can I add judges to an event?
  • Can I register an organisation for an event?
  • Can I withdraw an organisation from an event?
  • Can I reinstate a withdrawn entry?
  • Can I mark an event registration as paid?
  • Can I auto-generate a schedule for an event?
  • Can I manually add an item to an event schedule?
  • Can I remove an item from an event schedule?
  • Can I add a score?
  • Can I remove a score?
  • Do the scores calculate correctly?

Bulk Emailer

  • Do the right recipients load?
  • Can I send a test email just to myself?
  • Can I send an email to selected members?
  • Do the template tags get replaced correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed new feature question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants