Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of assertValue() on elements which don't support the value attribute #934

Closed
u01jmg3 opened this issue Oct 11, 2021 · 1 comment
Closed

Comments

@u01jmg3
Copy link
Contributor

u01jmg3 commented Oct 11, 2021

  • Dusk Version: 6.18.1
  • Laravel Version: 6.20.35
  • PHP Version: 7.4 / 8.1

Description:

Recently I realised assertValue() can be used with any element, even those that don't support the value attribute.

// <div class="foo">bar</div>

$browser->assertValue('.foo', ''); // Will always be true

$browser->assertValue('.foo', 'bar'); // Will always be false

Should there be a check that assertValue() is being called on an element that supports the value attribute?

These are the 7 elements which support the value attribute (source):

  • button
  • input
  • li
  • meter
  • option
  • progress
  • param

Happy to put together a PR if this is something you are interested in rectifying.

@driesvints
Copy link
Member

Hmm, yeah I think so. Feel free to PR 👍

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

No branches or pull requests

2 participants