Skip to content

Comments

fix(types): update Markdown.test.tsx to use getAttribute#522

Merged
jdhoffa merged 1 commit intomainfrom
fix-ts_errors_markdown_test
Nov 6, 2025
Merged

fix(types): update Markdown.test.tsx to use getAttribute#522
jdhoffa merged 1 commit intomainfrom
fix-ts_errors_markdown_test

Conversation

@jdhoffa
Copy link
Collaborator

@jdhoffa jdhoffa commented Nov 5, 2025

  • Replace direct property access (.target, .rel, etc.) with getAttribute()
  • Add nullish coalescing for unset attributes that return null
  • Update href test to use toMatch for more flexible assertion
  • Clean up test formatting and remove unnecessary object wrapping

Relates to #514

Copilot AI review requested due to automatic review settings November 5, 2025 14:38
@jdhoffa jdhoffa changed the title fix: update Markdown.test.tsx to use getAttribute fix(types): update Markdown.test.tsx to use getAttribute Nov 5, 2025
@jdhoffa jdhoffa requested a review from AlexAxthelm November 5, 2025 14:38
@github-actions
Copy link

github-actions bot commented Nov 5, 2025

Expected version change and release notes:

1.5.0-dev.19 (v1.5.0-dev.18...fix-ts_errors_markdown_test ) (2025-11-05T14:39 UTC)

Fixes

  • update Markdown test to use getAttribute (e81a437)

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 standardizes test assertions in the Markdown component tests by consistently using getAttribute() instead of direct DOM property access.

  • Refactored all DOM property assertions (e.g., a.target, a.rel, a.href) to use getAttribute() method
  • Added nullish coalescing (?? "") for assertions expecting empty strings when attributes are absent
  • Changed assertions to use regex matching where appropriate (e.g., toMatch(/#section$/))

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

@github-actions
Copy link

github-actions bot commented Nov 5, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-522.westus2.2.azurestaticapps.net

@jdhoffa jdhoffa merged commit 2e1eff8 into main Nov 6, 2025
16 checks passed
@jdhoffa jdhoffa deleted the fix-ts_errors_markdown_test branch November 6, 2025 10:05
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