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: fix baseline tests to pass #58

Merged
merged 1 commit into from
Oct 24, 2024
Merged

Conversation

abn
Copy link
Contributor

@abn abn commented Oct 24, 2024

Some of the tests were failing due to recent changes (eg: energyIQOverview). Fixed them up and updated Home info response.

Test Console Output

$ pnpm test

> [email protected] test /home/.../node-tado-client
> nyc mocha



  OAuth2 tests
    ✔ Should login
    ✔ Should fail to login
    ✔ Should login then refresh token

  Low-level API tests
    ✔ Login and get "me"
    ✔ Don't login and get "me"
    ✔ Login and fail to get "me"

  High-level API tests
    ✔ Should get the current user
    ✔ Should get home
    ✔ Should get the weather
    ✔ Should get the devices
    ✔ Should get the device temperature offset
    ✔ Should get the installations
    ✔ Should get the users
    ✔ should get the home state
    ✔ Should get the mobile devices
    ✔ Should get a mobile device
    ✔ Should get a mobile device settings
    ✔ Should get zones
    ✔ Should get a zone's state
    ✔ Should get a zone's capabilities
    ✔ Should get a zone's day report
    ✔ Should get a zone's overlay
    ✔ should get a zone's timetables
    ✔ should get a zone's away configuration
    ✔ should get a timetable
    ✔ Should clear a zone's overlay
    ✔ Should set a zone's overlay to Off
    ✔ Should set a zone's overlay to On with no temperature
    ✔ Should set a zone's overlay to On with Timer resume
    ✔ Should set a zone's overlay to On with Auto resume
    ✔ Should set a zone's overlay to On until next time block 
    ✔ Should set a device's temperature offset
    ✔ Should get identify a device
    ✔ Should get getEnergyIQOverview
    ✔ Should get energyIQ Tariff
    ✔ Should update energyIQ Tariff
    ✔ Should get energyIQ meter readings
    ✔ Should add energyIQ meter readings
    ✔ Should get energyIQ savings


  39 passing (281ms)

-----------|---------|----------|---------|---------|---------------------------------------------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                                               
-----------|---------|----------|---------|---------|---------------------------------------------------------------------------------
All files  |   54.28 |    38.57 |   67.44 |   54.33 |                                                                                 
 src       |   53.48 |    37.68 |   66.66 |   53.52 |                                                                                 
  index.ts |   53.48 |    37.68 |   66.66 |   53.52 | 129,134-138,224-228,245-246,270,341-343,377,394-404,447-487,498,526-639,666-742 
 src/types |     100 |      100 |     100 |     100 |                                                                                 
  enums.ts |     100 |      100 |     100 |     100 |                                                                                 
-----------|---------|----------|---------|---------|---------------------------------------------------------------------------------

39,43c39,43
<     1) Should set a zone's overlay to Off
<     2) Should set a zone's overlay to On with no temperature
<     3) Should set a zone's overlay to On with Timer resume
<     4) Should set a zone's overlay to On with Auto resume
<     5) Should set a zone's overlay to On until next time block 
---
>     ✔ Should set a zone's overlay to Off
>     ✔ Should set a zone's overlay to On with no temperature
>     ✔ Should set a zone's overlay to On with Timer resume
>     ✔ Should set a zone's overlay to On with Auto resume
>     ✔ Should set a zone's overlay to On until next time block 
46,48c46,48
<     6) Should get energyIQ
<     7) Should get energyIQ Tariff
<     8) Should update energyIQ Tariff
---
>     ✔ Should get getEnergyIQOverview
>     ✔ Should get energyIQ Tariff
>     ✔ Should update energyIQ Tariff
54,55c54
<   31 passing (239ms)
<   8 failing

@abn
Copy link
Contributor Author

abn commented Oct 24, 2024

@mattdavis90 I can add a github workflow to do test/lint checks once #57 and #58 are merged if you are open to it.

@mattdavis90
Copy link
Owner

Thanks for this. I've totally neglected the tests for ages because they don't really test much - I was initially using them mostly as a reminder for myself what the HTTP requests and responses look like before the repo was converted to Typescript. Thanks for getting them working again though!

@mattdavis90 mattdavis90 merged commit 3a72f15 into mattdavis90:master Oct 24, 2024
@abn abn deleted the fix-tests branch October 24, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants