mirror of
				https://gitee.com/vant-contrib/vant.git
				synced 2025-10-31 03:22:08 +08:00 
			
		
		
		
	component unit test
This commit is contained in:
		
							parent
							
								
									56fe6b5704
								
							
						
					
					
						commit
						66db79484d
					
				
							
								
								
									
										16
									
								
								test/unit/specs/actionsheet.spec.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								test/unit/specs/actionsheet.spec.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,16 @@ | |||||||
|  | import { createVue } from '../creater'; | ||||||
|  | import ActionSheet from 'packages/actionsheet'; | ||||||
|  | 
 | ||||||
|  | describe('ActionSheet', () => { | ||||||
|  |   let vm; | ||||||
|  |   afterEach(() => { | ||||||
|  |     vm && vm.destroy(); | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|  |   it('create', () => { | ||||||
|  |     vm = createVue(ActionSheet); | ||||||
|  |     vm.mount(); | ||||||
|  | 
 | ||||||
|  |     expect(vm.el.classList.contains('zan-actionsheet')).to.true; | ||||||
|  |   }); | ||||||
|  | }); | ||||||
							
								
								
									
										20
									
								
								test/unit/specs/card.spec.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								test/unit/specs/card.spec.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,20 @@ | |||||||
|  | import { createVue } from '../creater'; | ||||||
|  | import Card from 'packages/card'; | ||||||
|  | 
 | ||||||
|  | describe('Card', () => { | ||||||
|  |   let vm; | ||||||
|  |   afterEach(() => { | ||||||
|  |     vm && vm.destroy(); | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|  |   it('create', () => { | ||||||
|  |     vm = createVue(Card, { | ||||||
|  |       title: 'card', | ||||||
|  |       desc: 'card', | ||||||
|  |       thumb: 'https://img.yzcdn.cn/upload_files/2017/02/17/FnDwvwHmU-OiqsbjAO5X7wh1KWrR.jpg!100x100.jpg' | ||||||
|  |     }); | ||||||
|  |     vm.mount(); | ||||||
|  | 
 | ||||||
|  |     expect(vm.el.classList.contains('zan-card')).to.true; | ||||||
|  |   }); | ||||||
|  | }); | ||||||
							
								
								
									
										16
									
								
								test/unit/specs/cell.spec.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								test/unit/specs/cell.spec.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,16 @@ | |||||||
|  | import { createVue } from '../creater'; | ||||||
|  | import CellGroup from 'packages/cell-group'; | ||||||
|  | 
 | ||||||
|  | describe('Cell', () => { | ||||||
|  |   let vm; | ||||||
|  |   afterEach(() => { | ||||||
|  |     vm && vm.destroy(); | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|  |   it('cell group create', () => { | ||||||
|  |     vm = createVue(CellGroup); | ||||||
|  |     vm.mount(); | ||||||
|  | 
 | ||||||
|  |     expect(vm.el.classList.contains('zan-cell-group')).to.true; | ||||||
|  |   }); | ||||||
|  | }); | ||||||
							
								
								
									
										16
									
								
								test/unit/specs/checkbox.spec.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								test/unit/specs/checkbox.spec.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,16 @@ | |||||||
|  | import { createVue } from '../creater'; | ||||||
|  | import Checkbox from 'packages/checkbox'; | ||||||
|  | 
 | ||||||
|  | describe('Checkbox', () => { | ||||||
|  |   let vm; | ||||||
|  |   afterEach(() => { | ||||||
|  |     vm && vm.destroy(); | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|  |   it('create', () => { | ||||||
|  |     vm = createVue(Checkbox); | ||||||
|  |     vm.mount(); | ||||||
|  | 
 | ||||||
|  |     expect(vm.el.classList.contains('zan-checkbox')).to.true; | ||||||
|  |   }); | ||||||
|  | }); | ||||||
							
								
								
									
										16
									
								
								test/unit/specs/field.spec.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								test/unit/specs/field.spec.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,16 @@ | |||||||
|  | import { createVue } from '../creater'; | ||||||
|  | import Field from 'packages/field'; | ||||||
|  | 
 | ||||||
|  | describe('Field', () => { | ||||||
|  |   let vm; | ||||||
|  |   afterEach(() => { | ||||||
|  |     vm && vm.destroy(); | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|  |   it('create', () => { | ||||||
|  |     vm = createVue(Field); | ||||||
|  |     vm.mount(); | ||||||
|  | 
 | ||||||
|  |     expect(vm.el.classList.contains('zan-field')).to.true; | ||||||
|  |   }); | ||||||
|  | }); | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user