blessing-skin-server/resources/assets/tests/scripts/modal.test.ts
2020-02-05 18:48:30 +08:00

14 lines
390 B
TypeScript

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