+import { shallowMount, createLocalVue } from '@vue/test-utils'
+import ForgotPassword from '../../src/pages/ForgotPassword.vue'
+const localVue = createLocalVue()
+describe('Login', () => {
+ $t: (msg) => { return msg }
+ forgotPassword: jest.fn()
+ store = new Vuex.Store({
+ state: { error: undefined, loading: false },
+ it('sets the correct default data', () => {
+ expect(typeof ForgotPassword.data).toBe('function')
+ const defaultData = ForgotPassword.data()
+ expect(defaultData.email).toBe('')
+ it('triggers forgotPassword action on submit button click with data', () => {
+ const wrapper = shallowMount(ForgotPassword, { localVue, store, mocks, stubs: ['router-link'] })
+ wrapper.setData({ email: 'e@mail.com' })
+ wrapper.find('#ForgotPassword').trigger('submit')
+ expect(actions.forgotPassword.mock.calls).toHaveLength(1)
+ expect(actions.forgotPassword.mock.calls[0][1]).toEqual({email: 'e@mail.com'})