-
Notifications
You must be signed in to change notification settings - Fork 669
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
Attr inheritance and InheritAttrs/InheritListeners #146
Comments
Hi Austio 😄 We should fix this. Are you able to make a PR? |
@eddyerburgh yes should be able to knock out over the weekend. |
Hey didn't make to over the weekend is a little more involved than was initially thinking, will work on this week. |
Hey @Austio, are you still intending to make a PR? |
Hey Edd, my bad, yes I do, should have some free time in the coming up week to add. If you have freetime please feel free to jump on it :) |
@eddyerburgh Hey so i worked on this and noticed something while i was working on the mount spec for it that i wanted to double check on. The attrs match but the rendered html is not what I expected. Could you check the spec here and the failed expectation to see if i'm on base? The PR has the rendered karma output from running the specs. Line that is failing PR (to my fork of vue-test-utils) |
@eddyerburgh hey hey, just bumping on this, no rush |
Hi Austio, sorry for the delay getting back to you. This behavior is due to how we add attrs once the vm is created. I'm looking into it now to see if there's a workaround |
@Austio thank you for working on this and making this library awesome! If you're waiting for this, here's one workaround: beforeEach(function() {
const WrapperComponent = {
components: { Button },
props: ['foo'],
template: '<Button ref="unit" :foo="foo" />',
};
this.mountUnit = (props) => {
const wrapper = mount(WrapperComponent, props);
wrapper.vm.$refs = wrapper.vm.$refs.unit.$refs;
return wrapper;
};
}); |
👋 Edd
I was writing some specs on a component that uses the
inheritAttrs
option. While looking at that I noticed that none of the extra props I was passing to components were not being added as attributes on the component.I dug a little deeper in the source and it appears the issue is that this occurs before the $mount function.
Please let me know what you think, have an example and some links below. Thanks!
// Example
Reference in Vue.js https://vuejs.org/v2/guide/components.html#Non-Prop-Attributes
I saw this on avoriaz eddyerburgh/avoriaz#87
The text was updated successfully, but these errors were encountered: