blessing-skin-server/resources/assets/tests/scripts/modal.test.ts

14 lines
366 B
TypeScript
Raw Normal View History

2019-11-28 16:24:12 +08:00
import 'bootstrap'
2019-11-30 23:19:03 +08:00
import * as modal from '@/scripts/modal'
2018-09-07 23:58:00 +08:00
2019-11-28 16:24:12 +08:00
test('show modal', async () => {
process.nextTick(() => {
expect(
document.querySelector('.modal-title')!.textContent,
).toBe('general.tip')
document.querySelector<HTMLButtonElement>('.btn-primary')!.click()
2019-03-15 11:42:41 +08:00
})
2019-11-30 23:19:03 +08:00
const { value } = await modal.showModal()
2019-11-28 16:24:12 +08:00
expect(value).toBe('')
2019-03-15 11:42:41 +08:00
})