-
Notifications
You must be signed in to change notification settings - Fork 665
Added support for CSS modules in hasClass #106
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
Conversation
Made some tweaks so that the function variables are not getting redefined at the cost of consiceness, sorry 😢. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a unit test please
Sure, i was going to add one but didn't have time yesterday. |
Checks the className against $style where available.
Added a unit test |
The compatibility tests are failing, it looks like $style is implemented differently in Vue 2.0.x To debug you can run the |
Should be good to go now, sorry about that.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test was correct, but the code needs to be changed.
Can you check how scoped classes are dealt with in Vue 2.0.x and add a fix?
You can see an example where we have different behavior depending on Vue version here - https://github.com/vuejs/vue-test-utils/blob/dev/src/wrappers/wrapper.js#L297.
And can you revert the test to the previous test, where you had a class but had a scoped style block |
@eddyerburgh I am not convinced the test was correct as to be able to use css modules, the class needs to be that of the mapped (found in |
|
@eddyerburgh this feature is for CSS modules, not scoped CSS. Hence the reference to css-modules in my last comment, the fact i am using |
Ah sorry 👍 You're right then, the test you have now looks correct |
Cool, thanks 👍 |
Checks the className against $style where available.