-
Notifications
You must be signed in to change notification settings - Fork 667
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
Tests for default scopedSlots not mounting #706
Comments
Also having a similar problem (beta 19, 20), scoped slot does not mount. const wrapper = shallowMount(dataTable, {
propsData: {
columns: [
new Column('id', 'ID').style({ width: '100px' }).expandable(false),
new Column('title', 'Title'),
new Column('name', 'Name'),
],
items: [
{ id: 1, title: 'Entry 1', name: 'John' },
],
},
slots: {
title: '<span>Test</span>',
},
scopedSlots: {
name: '<span slot-scope="props">{{ props.item.title + props.item.name }}</span>',
},
});
const cells = wrapper.findAll('.og-dt__cell');
expect(cells.at(0).element.innerHTML).to.equal('1');
expect(cells.at(1).element.innerHTML).to.equal('<span>Test</span>');
expect(cells.at(2).element.innerHTML).to.equal('<span>Entry 1John</span>'); check: expect(cells.at(2).element.innerHTML).to.equal('<span>Entry 1John</span>'); never passess and |
I'm currently using https://github.com/posva/vue-promised as a reference to write tests for scoped slots. |
I have also a problem with scoped slot but maybe a bit more complex (slot is passed from parent to child). The slot is not applied during test with "mount" whereas it renders on a browser. |
@eddyerburgh |
I will send pull request to resolve this issue within 4 days. |
I was encountering similar scoped slot testing issues when using a
|
I think it was resolved at #893. |
* ✨ (KClipboardProvider) add copy to clipboard provider component * 📦 (vue-test-utils) bump version to fix scopedSlots trim bug - From vuejs/vue-test-utils#706 * 📦 (dep) bump dependencies - storybook wasn't working, new storybook works now - have parity with Vue version of kong-admin * 📚 (KClipboardProvider) correct version and add jsdoc * 📚 (storybook) use action instead of window.alert
Version
1.0.0-beta.18
Reproduction link
https://codesandbox.io/s/0mrvjmvk6l
Steps to reproduce
Hi there, so I’m building a library for work and I’m using the render function and only accepting default scoped slots. I have the render function currently defined as
When I try to write tests for it (using jest) I always get an error when trying to mount the component
I also tried
The error is
I don't know what I'm doing wrong, can someone please help me figure this out?
What is expected?
Expecting the test to pass
What is actually happening?
The error is
The text was updated successfully, but these errors were encountered: