import { mount } from '@vue/test-utils'
import Vue from 'vue'
import VueRouter from 'vue-router'
import configStore from './mocks/config-store'
import storeMock from './mocks/store-mock'
import routerMock from './mocks/router-mock'

import AuthLogin from '@/views/AuthLogin.vue'

Vue.use(VueRouter)

Vue.prototype.$auth = {
  check: jest.fn(),
  ready: jest.fn(),
}

describe('AuthLogin.vue', () => {
  const router = new VueRouter(routerMock)
  const store = configStore(Vue, storeMock)

  it('should render correct contents', () => {
    const wrapper = mount(AuthLogin, {
      store,
      router,
      stubs: ['router-link']
    })

    expect(wrapper.findAll('.vm-input').length).toBe(2)
    expect(wrapper.find('.vm-con-loading__container'))
  })
})
