StandardButtons.spec.js 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. import Vue from 'vue'
  2. import { shallowMount } from '@vue/test-utils'
  3. import CoreuiVue from '@coreui/vue'
  4. import StandardButtons from '@/views/buttons/StandardButtons'
  5. Vue.use(CoreuiVue)
  6. describe('StandardButtons.vue', () => {
  7. it('has a name', () => {
  8. expect(StandardButtons.name).toBe('StandardButtons')
  9. })
  10. it('has a created hook', () => {
  11. expect(typeof StandardButtons.data).toMatch('function')
  12. })
  13. it('sets the correct default data', () => {
  14. expect(typeof StandardButtons.data).toMatch('function')
  15. const defaultData = StandardButtons.data()
  16. expect(defaultData.togglePress).toBe(false)
  17. })
  18. it('is Vue instance', () => {
  19. const wrapper = shallowMount(StandardButtons)
  20. expect(wrapper.vm).toBeTruthy()
  21. })
  22. it('is StandardButtons', () => {
  23. const wrapper = shallowMount(StandardButtons)
  24. expect(wrapper.findComponent(StandardButtons)).toBeTruthy()
  25. })
  26. test('renders correctly', () => {
  27. const wrapper = shallowMount(StandardButtons)
  28. expect(wrapper.element).toMatchSnapshot()
  29. })
  30. })