Skip to content

Commit

Permalink
test(utils): add more dom tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cycleccc committed Aug 17, 2024
1 parent fb2cc6f commit 53bee8d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/basic-modules/__tests__/utils/dom.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @description utils dom
* @author cycleccc
*/

import { getTagName } from '../../src/utils/dom'
import { Dom7Array } from 'dom7'

describe('redo menu', () => {
it('get tag name', () => {
// 模拟一个空的 Dom7Array 对象
const emptyElem: Dom7Array = [] as unknown as Dom7Array

const result = getTagName(emptyElem)
expect(result).toBe('') // 验证返回的是空字符串
})
})

0 comments on commit 53bee8d

Please sign in to comment.