mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2024-11-10 09:39:14 +08:00
test: nested component
This commit is contained in:
parent
6913a51ee8
commit
92db537e84
@ -74,6 +74,16 @@ describe('Transform JSX', () => {
|
||||
expect(wrapper.html()).toBe('<div>123</div><div>456</div>');
|
||||
});
|
||||
|
||||
test('nested component', () => {
|
||||
const A = {};
|
||||
|
||||
A.B = () => <div>123</div>;
|
||||
|
||||
const wrapper = mount(() => <A.B />);
|
||||
|
||||
expect(wrapper.html()).toBe('<div>123</div>');
|
||||
});
|
||||
|
||||
test('xlink:href', () => {
|
||||
const wrapper = shallowMount({
|
||||
setup() {
|
||||
@ -89,7 +99,7 @@ describe('Transform JSX', () => {
|
||||
return () => <div class="a" {...{ class: 'b' } } />;
|
||||
},
|
||||
});
|
||||
expect(wrapper.html()).toBe('<div class="a b"></div>');
|
||||
expect(wrapper.classes().sort()).toEqual(['a', 'b'].sort());
|
||||
});
|
||||
|
||||
test('Merge style', () => {
|
||||
@ -248,6 +258,7 @@ describe('Transform JSX', () => {
|
||||
describe('Patch Flags', () => {
|
||||
let renders = 0;
|
||||
const Child = {
|
||||
props: ['text'],
|
||||
setup(props) {
|
||||
return () => {
|
||||
renders++;
|
||||
|
Loading…
Reference in New Issue
Block a user