Skip to content

Add cached todo widget state test#6889

Open
sgallese wants to merge 1 commit into
home-assistant:mainfrom
sgallese:add-cached-todo-widget-state-test
Open

Add cached todo widget state test#6889
sgallese wants to merge 1 commit into
home-assistant:mainfrom
sgallese:add-cached-todo-widget-state-test

Conversation

@sgallese
Copy link
Copy Markdown

Summary

This is a test-only change to pin existing cached todo widget state behavior before any follow-up cleanup.

It adds coverage for how TodoStateWithData.from(todoEntity) maps latestUpdateData into display state.

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

Screenshots

No UI changes.

Link to pull request in documentation repositories

User Documentation: not needed; no user-facing functionality change.

Developer Documentation: not needed; no developer-facing documentation change.

Any other notes

This intentionally adds test coverage only and does not change widget, server, auth, location, notification, or schema behavior.

Validation:

  • ./gradlew :app:testFullDebugUnitTest --tests io.homeassistant.companion.android.widgets.todo.TodoWidgetStateTest
  • ./gradlew :app:ktlintCheck

Copilot AI review requested due to automatic review settings May 24, 2026 00:05
Copy link
Copy Markdown

@home-assistant home-assistant Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sgallese

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant home-assistant Bot marked this pull request as draft May 24, 2026 00:05
@home-assistant
Copy link
Copy Markdown

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds test coverage for mapping a TodoWidgetEntity containing cached latestUpdateData into the runtime TodoStateWithData model.

Changes:

  • Added a unit test verifying TodoStateWithData.from(todoEntity) correctly maps cached list name/items and marks the state as out-of-sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants