[new feature] Dialog: add title slot (#3985)

This commit is contained in:
neverland
2019-07-28 10:36:25 +08:00
committed by GitHub
parent 15046888d9
commit 3299fb6d39
5 changed files with 61 additions and 6 deletions
+24
View File
@@ -102,3 +102,27 @@ test('button text', () => {
test('dialog component', () => {
expect(Dialog.Component).toEqual(DialogVue);
});
test('default slot', () => {
const wrapper = mount(DialogVue, {
propsData: {
value: true
},
scopedSlots: {
default: () => 'Custom Message'
}
});
expect(wrapper).toMatchSnapshot();
});
test('title slot', () => {
const wrapper = mount(DialogVue, {
propsData: {
value: true
},
scopedSlots: {
title: () => 'Custom Title'
}
});
expect(wrapper).toMatchSnapshot();
});