Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a follow up to the new web-test-runner testing PR with more fixes to increase code coverage reporting.
Three new tests written to cover 3 edge cases that had no coverage before
When fixing this third one I found the is element disabled checking is used in multiple places without the eltIsDisabled() helper function so fixed this in three places
There was a bug with webkit testing microsoft/playwright#5894 that had a try catch inserted to handle but after much time testing old versions I reproduced the issue again but found it was fixed in 2022 with webkit 16.0 so we can now safely remove this workaround.
There was also a bug/edge-case i found that is not currently handled perfectly when it runs removeValueFromFormData to remove an input that will be included on a form it only removes the input value and not multiple values in array. To fix this issue I moved a chunk of value lookup logic into a sub function getValueFromInput() so it can be ruesed by the removeValueFromFormData as well which solved the bug and the code coverage issue. Updated my test for this to show the impact.
FormData proxy had a block of code that could not be executed to test because it seems like an invalid fallback we don't need. checked with @Telroshan to confirm it wasn't needed.
Finally there were several element checks that I found were just not needed and found several of the JSDocs had Node when they should be Element which solved this issue. Part of the confusion here is that resolveTarget() function can return node types instead of Element when dealing with some situations like from triggers as you can have document here as an option (maybe we need two resolveTarget functions??). But for the main target use case it will only ever return an Element and be valid. I managed to hack around it to make it target a non element text node but this just breaks things later as it tries to add a class to the target so its just not supported right now.
Corresponding issue:
Testing
mostly tested using new testing suite
Checklist
masterfor website changes,devforsource changes)
approved via an issue
npm run test) and verified that it succeeded