Login.spec.js 778 B

12345678910111213141516171819202122232425262728
  1. import Vue from 'vue'
  2. import { shallowMount } from '@vue/test-utils'
  3. import CoreuiVue from '@coreui/vue'
  4. import Login from '@/views/pages/Login'
  5. Vue.use(CoreuiVue)
  6. describe('Login.vue', () => {
  7. it('has a name', () => {
  8. expect(Login.name).toBe('Login')
  9. })
  10. it('is Vue instance', () => {
  11. const wrapper = shallowMount(Login)
  12. expect(wrapper.vm).toBeTruthy()
  13. })
  14. it('is Login', () => {
  15. const wrapper = shallowMount(Login)
  16. expect(wrapper.findComponent(Login)).toBeTruthy()
  17. })
  18. it('should render correct content', () => {
  19. const wrapper = shallowMount(Login)
  20. expect(wrapper.find('h1').text()).toMatch('Login')
  21. })
  22. test('renders correctly', () => {
  23. const wrapper = shallowMount(Login)
  24. expect(wrapper.element).toMatchSnapshot()
  25. })
  26. })