Allow to specify id for modal
This commit is contained in:
parent
e5b8a130a0
commit
a0a950089e
|
|
@ -1,5 +1,6 @@
|
|||
<template>
|
||||
<div
|
||||
:id="id"
|
||||
class="modal fade"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
|
|
@ -72,6 +73,9 @@ export default {
|
|||
default: 'confirm',
|
||||
validator: value => ['alert', 'confirm', 'prompt'].includes(value),
|
||||
},
|
||||
id: {
|
||||
type: String,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: trans('general.tip'),
|
||||
|
|
|
|||
|
|
@ -2,6 +2,15 @@ import 'bootstrap'
|
|||
import { mount } from '@vue/test-utils'
|
||||
import Modal from '@/components/Modal.vue'
|
||||
|
||||
test('id', () => {
|
||||
const wrapper = mount(Modal, {
|
||||
propsData: {
|
||||
id: 'id',
|
||||
},
|
||||
})
|
||||
expect(wrapper.find('#id').exists()).toBeTrue()
|
||||
})
|
||||
|
||||
test('title', () => {
|
||||
const wrapper = mount(Modal, {
|
||||
propsData: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user