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

TypeError: to.have.style is not a function #224

Open
filipenatanael opened this issue Dec 5, 2018 · 1 comment
Open

TypeError: to.have.style is not a function #224

filipenatanael opened this issue Dec 5, 2018 · 1 comment

Comments

@filipenatanael
Copy link

Hello Everyone,

So I'm getting the below error message when trying to run the tests.

expect(wrapper).to.have.style('background-color').equal('#ccc');

  • TypeError: (0 , _chai.expect)(...).to.have.style is not a function"

But when I write the code as below, everything works correctly.

expect(wrapper.props().style.backgroundColor).to.be.equal('#ccc');

Any of yours have gone through this before?

@filipenatanael filipenatanael changed the title to.have.style is not a function TypeError: to.have.style is not a function Dec 13, 2018
@kislakiruben
Copy link

@filipenatanael isn't wrapper an enzyme wrapper, so it doesn't have any style actually on it? you should look for the wrapping html element instead for the styles to show.

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