Skip to content

Commit b76cd58

Browse files
committed
Merge a redundant test into other tests
1 parent 51bc82a commit b76cd58

File tree

1 file changed

+6
-30
lines changed

1 file changed

+6
-30
lines changed

src/__tests__/vue-vnode-utils.spec.ts

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -126,36 +126,6 @@ function compareNode(vnode: VNode, expectation: VNode) {
126126
compareChildren([].concat(vnode.children as any), [].concat(expectation.children as any))
127127
}
128128

129-
describe('isElement', () => {
130-
it('isElement - 36bc', () => {
131-
const elNode = h('div')
132-
const cmpNode = h({ render (){} })
133-
const fnCmpNode = h(() => {})
134-
const commentNode = createCommentVNode('Comment')
135-
const textNode = createTextVNode('Some text')
136-
const fragmentNode = createVNode(Fragment, null, [elNode])
137-
138-
expect(isElement(elNode)).toBe(true)
139-
140-
expect(isElement(null)).toBe(false)
141-
expect(isElement(undefined)).toBe(false)
142-
expect(isElement(false)).toBe(false)
143-
expect(isElement(true)).toBe(false)
144-
expect(isElement(0)).toBe(false)
145-
expect(isElement(1)).toBe(false)
146-
expect(isElement('')).toBe(false)
147-
expect(isElement('string')).toBe(false)
148-
expect(isElement([])).toBe(false)
149-
expect(isElement({})).toBe(false)
150-
151-
expect(isElement(cmpNode)).toBe(false)
152-
expect(isElement(fnCmpNode)).toBe(false)
153-
expect(isElement(commentNode)).toBe(false)
154-
expect(isElement(textNode)).toBe(false)
155-
expect(isElement(fragmentNode)).toBe(false)
156-
})
157-
})
158-
159129
describe('addProps', () => {
160130
it('addProps - 0836', () => {
161131
let count = 0
@@ -1660,7 +1630,9 @@ describe('isElement', () => {
16601630
expect(isElement(h(defineAsyncComponent(() => Promise.resolve({}))))).toBe(false)
16611631
expect(isElement(createTextVNode('Text'))).toBe(false)
16621632
expect(isElement(createCommentVNode('Text'))).toBe(false)
1633+
expect(isElement(createVNode(Fragment, null, [h('div')]))).toBe(false)
16631634
expect(isElement('')).toBe(false)
1635+
expect(isElement('string')).toBe(false)
16641636
expect(isElement({})).toBe(false)
16651637
expect(isElement([])).toBe(false)
16661638
expect(isElement(null)).toBe(false)
@@ -1685,6 +1657,7 @@ describe('isFragment', () => {
16851657
expect(isFragment(createTextVNode('Text'))).toBe(false)
16861658
expect(isFragment(createCommentVNode('Text'))).toBe(false)
16871659
expect(isFragment('')).toBe(false)
1660+
expect(isFragment('string')).toBe(false)
16881661
expect(isFragment({})).toBe(false)
16891662
expect(isFragment(null)).toBe(false)
16901663
expect(isFragment(undefined)).toBe(false)
@@ -1698,6 +1671,7 @@ describe('isFragment', () => {
16981671
describe('isText', () => {
16991672
it('isText - 7952', () => {
17001673
expect(isText('')).toBe(true)
1674+
expect(isText('string')).toBe(true)
17011675
expect(isText(0)).toBe(true)
17021676
expect(isText(7)).toBe(true)
17031677
expect(isText(createTextVNode('Text'))).toBe(true)
@@ -1731,6 +1705,7 @@ describe('isStatic', () => {
17311705
expect(isStatic(createCommentVNode('Text'))).toBe(false)
17321706
expect(isStatic(createVNode(Fragment, null, []))).toBe(false)
17331707
expect(isStatic('')).toBe(false)
1708+
expect(isStatic('string')).toBe(false)
17341709
expect(isStatic({})).toBe(false)
17351710
expect(isStatic([])).toBe(false)
17361711
expect(isStatic(null)).toBe(false)
@@ -1773,6 +1748,7 @@ describe('getType', () => {
17731748
expect(getType(createVNode(Fragment, null, []))).toBe('fragment')
17741749
expect(getType(createStaticVNode('<div></div>', 1))).toBe('static')
17751750
expect(getType('')).toBe('text')
1751+
expect(getType('string')).toBe('text')
17761752
expect(getType({})).toBe(undefined)
17771753
expect(getType([])).toBe('fragment')
17781754
expect(getType(null)).toBe('comment')

0 commit comments

Comments
 (0)