kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
				
				
				
			Added one basic unittest for component
							rodzic
							
								
									a4ce093919
								
							
						
					
					
						commit
						083b7b8e2f
					
				|  | @ -0,0 +1,10 @@ | |||
| import Username from '@/components/common/Username.vue' | ||||
| 
 | ||||
| import { render } from '../../utils' | ||||
| 
 | ||||
| describe('Username', () => { | ||||
|   it('displays username', () => { | ||||
|     const vm = render(Username, {username: 'Hello'}) | ||||
|     expect(vm.$el.textContent).to.equal('Hello') | ||||
|   }) | ||||
| }) | ||||
|  | @ -1,4 +1,11 @@ | |||
| // helper for testing action with expected mutations
 | ||||
| import Vue from 'vue' | ||||
| 
 | ||||
| export const render = (Component, propsData) => { | ||||
|   const Constructor = Vue.extend(Component) | ||||
|   return new Constructor({ propsData: propsData }).$mount() | ||||
| } | ||||
| 
 | ||||
| export const testAction = ({action, payload, params, expectedMutations, expectedActions}, done) => { | ||||
|   let mutationsCount = 0 | ||||
|   let actionsCount = 0 | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Eliot Berriot
						Eliot Berriot