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

Revisit attribute handling #4

Open
avik-das opened this issue Jun 15, 2015 · 0 comments
Open

Revisit attribute handling #4

avik-das opened this issue Jun 15, 2015 · 0 comments
Assignees

Comments

@avik-das
Copy link
Owner

As per #1:

I think the absence of class is very rare case to test and it can already be handled easily without this library by common react testing practices. So it should be better to treat expected string differently.
As an enumeration of what is absolutely required to be found in a rendered node.

  1. If we include attribute in expected string – we require its presence
  2. If we don't include attribute – we're agnostic about it

Then we don't need to create and support that clunky white and black lists with magic "defaults".
As I already said, If we still do need to query against some attributes in a more explicit form we always can fallback to lower level tools.

I believe this approach is more sane than the current one. You can also make a described one a default behavior with alternatives switched by flags but I tend to think that such global and rigid control is a bad style.

For some nodes you want to be more precise, for others – less precise and this is probably
just impossible to preconfigure through options.

This brings up some great points. I looked through my usages of this library, and I think the above approach makes sense. I'll try implementing the above approach and see if it really works for these use cases.

@avik-das avik-das self-assigned this Jun 15, 2015
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

1 participant