enzymejs/enzyme

Support escaped characters in selectors

Open

#1218 aperta il 3 ott 2017

Vedi su GitHub
 (14 commenti) (0 reazioni) (0 assegnatari)JavaScript (2016 fork)batch import
feature requesthelp wanted

Metriche repository

Star
 (19.979 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Edit from maintainers: this issue was repurposed, see https://github.com/airbnb/enzyme/issues/1218#issuecomment-334489966

Settings

  • React v16
  • Enzyme v3

When i have a component which has a className prop with special character / or @ , it doesnt select anything. I feel enzyme breaks and doesn't continue with the lines after this selector.

Example

const sampleComponent = () => (
    <div className="u-width-1/2@small">
        Something here
    </div>
);

If I have the above component and if I want to select the div containing u-width-1/2@small I tried

const component = shallow(<sampleComponent />);
component.find('.u-width-1/2@small') // This line seems to fail due to error in selector
/* Anything after this doesnt execute */

Guida contributor