mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-22 11:33:35 +08:00
Share workspace packages between Ray Admin and the interactive docs. BREAKING CHANGE: v6 is a new major line. v5 stays on legacy/v5.
37 lines
877 B
TypeScript
37 lines
877 B
TypeScript
import { mount } from '@vue/test-utils'
|
|
import { RModal } from '../../apps/admin/src/components/RModal/index'
|
|
|
|
describe('RModal', () => {
|
|
it('should execute the onAfterEnter callback', () => {
|
|
mount(RModal, {
|
|
props: {
|
|
show: true,
|
|
onAfterEnter: () => {
|
|
assert(true)
|
|
},
|
|
},
|
|
slots: {
|
|
default: h('div', 'Hello World'),
|
|
},
|
|
})
|
|
})
|
|
|
|
it('should render a modal', async () => {
|
|
const wrapper = mount(RModal, {
|
|
props: {
|
|
show: true,
|
|
},
|
|
slots: {
|
|
default: h('div', 'Hello World'),
|
|
},
|
|
})
|
|
const classStr = 'n-modal-container'
|
|
|
|
const modal = document.body.querySelector(`.${classStr}`)
|
|
const modalClassList = Array.from(modal?.classList || [])
|
|
|
|
expect(modalClassList.length).not.toBe(0)
|
|
expect(modalClassList.includes(classStr)).toBe(true)
|
|
})
|
|
})
|