mirror of
https://github.com/koel/koel
synced 2024-11-10 14:44:13 +00:00
Add test for login form
This commit is contained in:
parent
93f6050858
commit
ec80ec49e9
1 changed files with 16 additions and 0 deletions
16
resources/assets/js/tests/components/auth/login-form.spec.js
Normal file
16
resources/assets/js/tests/components/auth/login-form.spec.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
import LoginForm from '@/components/auth/login-form.vue'
|
||||
|
||||
describe('components/auth/login-form', () => {
|
||||
it('displays a form for users to log in', () => {
|
||||
const wrapper = shallow(LoginForm)
|
||||
expect(wrapper.findAll('form')).toHaveLength(1)
|
||||
})
|
||||
|
||||
it('triggers login method when form is submitted', () => {
|
||||
const spy = sinon.spy()
|
||||
const wrapper = shallow(LoginForm)
|
||||
wrapper.vm.login = spy
|
||||
wrapper.find('form').trigger('submit')
|
||||
expect(spy.called).toBe(true)
|
||||
})
|
||||
})
|
Loading…
Reference in a new issue