提交 cd66c024 authored 作者: 王鹏飞's avatar 王鹏飞

test(admin): protect editor shell boundary

上级 ee43c2c1
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { describe, expect, it } from 'vitest'
const shellPath = resolve(process.cwd(), 'src/common/wangeditor-customer/shell/WangEditorCustomer.jsx')
const shellSource = readFileSync(shellPath, 'utf8')
describe('WangEditorCustomer shell boundary', () => {
it('depends on the feature composition entry rather than feature internals', () => {
expect(shellSource).not.toMatch(/from\s+['"][^'"]*features\//)
})
it.each([
'ImageMenuClick',
'GalleryMenuClick',
'PracticeMenuClick',
'window.dispatchEvent',
'document.querySelector(',
])('does not contain %s', forbidden => {
expect(shellSource).not.toContain(forbidden)
})
})
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论