DevExpress / testcafe-hammerhead

A powerful web-proxy used as a core for the TestCafe testing framework. :hammer: :smiley:
https://testcafe.io
MIT License
171 stars 160 forks source link

fix: support non-canonicalised srcset attribute name #2958 #2968

Closed gg-kialo closed 1 year ago

gg-kialo commented 1 year ago

Some frameworks, like React, use non-canonicalised attribute names. The spec and browsers allow this, but hammerhead is only checking if the attribute name without canonicalisation matches srcset.

By using the loweredAttr for the comparison, hammerhead will be more accepting of inputs and resolve srcset issues with React projects (fixes #2958).

See https://github.com/facebook/react/issues/10863 for more background.

Purpose

Fixes #2958 to better support srcSet attributes in React applications.

Approach

Canonicalises the attribute name before comparing to srcset.

References

Related react issue (and there are various duplicates of this) - https://github.com/facebook/react/issues/10863

Pre-Merge TODO

gg-kialo commented 1 year ago

fyi: both locally and in github codespaces I've been unable to get the tests to run. After running gulp test-client nothing happens after QUnit server starts to listen.

...
[10:41:29] Finished 'lint' after 12 s
[10:41:29] Finished 'build' after 17 s
[10:41:29] Starting 'test-client-run'...
QUnit server listens on http://localhost:2000

I tried adding adding a test but since removed it since it was failing. I don't think it was testing the right thing.

gg-kialo commented 1 year ago

I've pushed with an added test. I managed to figure how to get them to run locally (you have to open the qunit server :facepalm:).

fyi, I'll be OoO until Tuesday.

github-actions[bot] commented 12 months ago

Release v31.6.3 addresses this.