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

14 lines
390 B
TypeScript
Raw Normal View History

2020-01-31 15:58:48 +08:00
import { trans } from '@/scripts/i18n'
2019-12-01 00:00:44 +08:00
import { showModal } 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(() => {
2020-02-05 18:48:30 +08:00
expect(document.querySelector('.modal-title')!.textContent).toBe(
trans('general.tip'),
)
2019-11-28 16:24:12 +08:00
document.querySelector<HTMLButtonElement>('.btn-primary')!.click()
2019-03-15 11:42:41 +08:00
})
2019-12-01 00:00:44 +08:00
const { value } = await showModal()
2019-11-28 16:24:12 +08:00
expect(value).toBe('')
2019-03-15 11:42:41 +08:00
})