[new feature] Dialog: add confirmButtonText、cancelButtonText prop (#3107)

This commit is contained in:
neverland
2019-04-08 20:27:50 +08:00
committed by GitHub
parent d3054fd4b0
commit fc412ce1aa
7 changed files with 63 additions and 10 deletions

View File

@@ -76,3 +76,27 @@ test('register component', () => {
Vue.use(Dialog);
expect(Vue.component(DialogVue.name)).toBeTruthy();
});
test('button color', () => {
const wrapper = mount(DialogVue, {
propsData: {
value: true,
showCancelButton: true,
cancelButtonColor: 'white',
confirmButtonColor: 'red'
}
});
expect(wrapper).toMatchSnapshot();
});
test('button text', () => {
const wrapper = mount(DialogVue, {
propsData: {
value: true,
showCancelButton: true,
cancelButtonText: 'Custom cancel',
confirmButtonText: 'Custom confirm'
}
});
expect(wrapper).toMatchSnapshot();
});