mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-10 15:32:44 +08:00
ef92b6c11c
* Add overlay component; Dialog component almost done * feat(dialog): add use-lockscreen * feat(dialog): coding completed awaiting tests * feat(dialog): finish writing test cases * fix test failures * Address PR comments * fallback some changes
16 lines
482 B
TypeScript
16 lines
482 B
TypeScript
import { ref, nextTick } from 'vue'
|
|
import { hasClass } from '@element-plus/utils/dom'
|
|
import useLockScreen from '../use-lockscreen'
|
|
|
|
describe('useLockScreen', () => {
|
|
test('should lock screen when trigger is true', async () => {
|
|
const _ref = ref(false)
|
|
const cls = 'el-popup-parent--hidden'
|
|
useLockScreen(_ref)
|
|
expect(hasClass(document.body, cls)).toBe(false)
|
|
_ref.value = true
|
|
await nextTick()
|
|
expect(hasClass(document.body, cls)).toBe(true)
|
|
})
|
|
})
|