mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2024-11-14 07:29:17 +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>');
|
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', () => {
|
test('xlink:href', () => {
|
||||||
const wrapper = shallowMount({
|
const wrapper = shallowMount({
|
||||||
setup() {
|
setup() {
|
||||||
@ -89,7 +99,7 @@ describe('Transform JSX', () => {
|
|||||||
return () => <div class="a" {...{ class: 'b' } } />;
|
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', () => {
|
test('Merge style', () => {
|
||||||
@ -248,6 +258,7 @@ describe('Transform JSX', () => {
|
|||||||
describe('Patch Flags', () => {
|
describe('Patch Flags', () => {
|
||||||
let renders = 0;
|
let renders = 0;
|
||||||
const Child = {
|
const Child = {
|
||||||
|
props: ['text'],
|
||||||
setup(props) {
|
setup(props) {
|
||||||
return () => {
|
return () => {
|
||||||
renders++;
|
renders++;
|
||||||
|
Loading…
Reference in New Issue
Block a user