Comments (7)
rquery
supports class and attribute selectors, as well as union (a, b
), descendent (a b
), and child (a > b
) syntax.
If these aren't working for you then there's potentially something else going on. As noted in #14, rquery
doesn't currently support shallow rendering.
from rquery.
does rquery
class selectors only allow one class? For instance, in my rquery
test, I examine the component and see these props
props:
{ className: 'button disabled',
onClick: [Object],
children: [Object] }
when I try either of these I get true
expect($component.find('.button')).to.have.length(1);
expect($component.find('.disabled')).to.have.length(1);
yet when I try to use the following, I get false
expect($component.find('.button.disabled')).to.have.length(1);
I tried the union syntax you mentioned ('.button, .disabled')
, but no luck there
from rquery.
Hmm, it should support chained class names. See test here.
from rquery.
ok, thanks... must be something weird going on... I will dig around and see what I can figure out.
from rquery.
Is className
being passed to a composite component? If so, that might be the problem.
from rquery.
For example:
- DOM component:
<div className="my-class" />
- Composite component:
<MyComponent className="my-class" />
It could be that .my-class
won't match className
on a composite component, I don't think there's a test for that scenario.
from rquery.
Closing for now until more details are provided.
from rquery.
Related Issues (12)
- Add more CSS-style selectors HOT 2
- Shouldn't get() return the actual underlying component? HOT 2
- Lodash is undefined in nodejs HOT 4
- Clicking doesn't work as expected HOT 12
- Extending RQuery? HOT 1
- Doesn't work with shallow rendering HOT 3
- can't find component in subqueries HOT 4
- Difficulty initializing from Travis CI HOT 5
- npm@latest gives version 2.0.9 of the library HOT 1
- Can't find child component using Shallow Rendering. HOT 2
- "TypeError: Cannot read property 'getAttribute' of null" form component without dom node HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rquery.