OpenSprinkler / OpenSprinkler-App

A mobile interface for the OpenSprinkler irrigation device. Designed to allow manual control, program management (preview, add, edit, and delete), initiation of a run-once program, viewing graphical and tabulated representations of log data, viewing device status, adjusting rain delay, and changing of OpenSprinkler settings.
https://opensprinkler.com
GNU Affero General Public License v3.0
169 stars 93 forks source link

chore(tests): refactor tests #179

Closed mellodev closed 2 days ago

mellodev commented 3 days ago

Changes Proposed

Demo Video or Screenshots

https://github.com/user-attachments/assets/5fa3815b-0620-4f09-8fbc-65c27904a23d

salbahra commented 3 days ago

Overall looks fantastic! Only issue is the repetitive Sinon mocks in each test file. I suspect that can move to a before in prepare tests once and remove the after() part. Let's find a way to reduce that to avoid the duplication (and facilitate an easy way to swap firmware version payloads to test the app with).

Thank you!

mellodev commented 3 days ago

Overall looks fantastic! Only issue is the repetitive Sinon mocks in each test file. I suspect that can move to a before in prepare tests once and remove the after() part. Let's find a way to reduce that to avoid the duplication (and facilitate an easy way to swap firmware version payloads to test the app with).

Thank you!

Good point, let me see if we can refactor that away!

mellodev commented 3 days ago

@salbahra done, please take another look. Need to think on the firmware swap logic for a bit, can do that in a future PR