blessing-skin-server/resources/assets/tests/scripts/modal.test.ts
2019-11-30 23:19:03 +08:00

14 lines
366 B
TypeScript

import 'bootstrap'
import * as modal from '@/scripts/modal'
test('show modal', async () => {
process.nextTick(() => {
expect(
document.querySelector('.modal-title')!.textContent,
).toBe('general.tip')
document.querySelector<HTMLButtonElement>('.btn-primary')!.click()
})
const { value } = await modal.showModal()
expect(value).toBe('')
})