Third-Culture-Software / bhima

A hospital information management application for rural Congolese hospitals
https://docs.bhi.ma/
GNU General Public License v2.0
220 stars 105 forks source link

Testing all our services, directives, and components #337

Open DedrickEnc opened 8 years ago

DedrickEnc commented 8 years ago

Our services, directives and components have not a unit test yet, I propose to begin writting test for each service and directive one by one. So our end to end test will be more simple because we will not try to test component during the end to end test, but we will just use them.

What do you think?

sfount commented 8 years ago

This is an excellent idea - I would recommend this is done one by one instead of all at once. A good example of a component that is tested by a number of modules is the date selection (too far in the future/ past validation).

The Session and Login services are used on every application load - these would also be priorities for test coverage.

jniles commented 8 years ago

Someone should make a list of the components/directives that need unit tests. We could tackle them one by one that way.

jniles commented 8 years ago

So, I did some analysis this weekend, and these are the directives/components that could use some unit tests written for them:

  1. bhFindPatient (at least the inline version, which seems to be the most used)
  2. bhCurrencyInput
  3. bhDateEditor
  4. bhInteger
  5. bhUnique
  6. bhLocationSelect
  7. bhLocationModal

Any of these can be tackled and worked on at any time. Since Travis now runs our unit tests (see #357), these tests will have a lot more value. If someone implements a test, they should reference this issue.