feat(Dialog): add allow-html prop (#6568)

This commit is contained in:
neverland
2020-06-19 06:13:46 +08:00
committed by GitHub
parent 95313ef459
commit 9b0f23e2da
5 changed files with 46 additions and 17 deletions

View File

@@ -1,5 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`allow-html prop 1`] = `<div class="van-dialog__message">&lt;span&gt;text&lt;/span&gt;</div>`;
exports[`button color 1`] = `
<div role="dialog" class="van-dialog" name="van-dialog-bounce">
<div class="van-hairline--top van-dialog__footer van-dialog__footer--buttons"><button class="van-button van-button--default van-button--large van-dialog__cancel" style="color: white;">

View File

@@ -127,6 +127,17 @@ test('title slot', () => {
expect(wrapper).toMatchSnapshot();
});
test('allow-html prop', () => {
const wrapper = mount(DialogComponent, {
propsData: {
value: true,
message: '<span>text</span>',
allowHtml: false,
},
});
expect(wrapper.find('.van-dialog__message')).toMatchSnapshot();
});
test('open & close event', () => {
const wrapper = mount(DialogComponent);
wrapper.vm.value = true;