Skip to content

Comments

chore: added initial tests for the component#26

Merged
troinine merged 5 commits intomainfrom
chore/add-tests
Dec 18, 2025
Merged

chore: added initial tests for the component#26
troinine merged 5 commits intomainfrom
chore/add-tests

Conversation

@troinine
Copy link
Owner

No description provided.

@troinine troinine added the ignore-for-release Ignored from release notes label Dec 18, 2025
@troinine troinine requested a review from Copilot December 18, 2025 16:18
Copy link
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

This PR adds initial test coverage for the weather forecast card component using Vitest and happy-dom. The tests validate rendering behavior, user interactions (like toggling between daily and hourly forecasts), and data display across different forecast modes.

  • Configures Vitest with happy-dom environment and custom plugin for handling Parcel bundle-text imports
  • Adds comprehensive tests for simple forecast, chart forecast, and general card functionality
  • Reduces mock subscription timeout from 1000ms to 100ms to improve test execution speed

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vitest.config.ts Configures Vitest with happy-dom and custom plugin for Parcel compatibility
test/weather-forecast-simple.test.ts Tests simple forecast mode rendering and interactions
test/weather-forecast-chart.test.ts Tests chart forecast mode with canvas rendering and data validation
test/weather-forecast-card.test.ts Tests core card functionality including temperature and condition display
test/vitest.setup.ts Suppresses console output during tests
test/mocks/test-data.ts Adds test fixture data for daily and hourly forecasts
test/mocks/hass.ts Reduces subscription callback timeout for faster test execution
src/components/wfc-weather-condition-icon-provider.ts Adds data-condition attribute to support test assertions
package.json Adds test scripts and dependencies (vitest, happy-dom, @open-wc/testing)
.github/workflows/build.yml Integrates test execution into CI workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

troinine and others added 2 commits December 18, 2025 18:22
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
@troinine troinine merged commit 9c56797 into main Dec 18, 2025
3 checks passed
@troinine troinine deleted the chore/add-tests branch December 18, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release Ignored from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant