Skip to content

fix(browser): compute toHaveStyle expected styles in Edge (fix #11668) - #11673

Open
fixfon wants to merge 1 commit into
vitest-dev:mainfrom
fixfon:fix/11668-tohavestyle-edge
Open

fixfon wants to merge 1 commit into
vitest-dev:mainfrom
fixfon:fix/11668-tohavestyle-edge

Conversation

@fixfon

@fixfon fixfon commented Oct 20, 2026

Copy link
Copy Markdown

Closes #11668

In Edge, toHaveStyle built the expected styles from an empty computed style, so a check like toHaveStyle({ display: 'grid' }) failed with display: on the expected side even when the element really was a grid. The two browser checks in toHaveStyle.ts only listed Chromium, and Edge is Chromium-based too, so I added edge next to it in both places.

I added a test that follows the repro from the issue. I ran it in real Edge (155, headless, webdriverio): on main it fails with the same - display: ; + display: grid; diff from the issue, and with this change all 15 toHaveStyle tests pass. Chromium is unchanged.

One caveat: CI doesn't run Edge, so the new test passes in Chromium there with or without the fix. Happy to drop it or move it somewhere else if you'd prefer.

@netlify

netlify Bot commented Oct 20, 2026

Copy link
Copy Markdown

✅ Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit b7a5f65
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6ad75f1a0057a41adf0b1a85
😎 Deploy Preview https://deploy-preview-11673--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

This branch has not been deployed

No deployments
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.

toHaveStyle: expected styles are always empty in Edge

1 participant