blessing-skin-server/resources/assets/tests/scripts/modal.test.ts
2020-05-19 09:33:41 +08:00

14 lines
388 B
TypeScript

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