mocks: {
            $store: {
                getters: {
                    StagingID: ' '
                },
                state: {app: {sidebar:{}
                    },
                    projectStaing: {stagingProjectID:' '}}}},Copy the code
// import { shallowMount } from '@vue/test-utils'
import ProjectStaging from '@/views/Content/ProjectPreparation/ProjectStaging/ProjectStaging.vue'
import Tree from '@/components/Searchtree/index.vue'
import DefaultErrorPage from '@/components/defaultPage/index.vue'
import {
    getVue,
    data
} from '.. /.. /.. /.. /__mocks__/vueBase'

import elementUi from 'element-ui'
// jest.mock('@/components/defaultPage/index.vue', () => jest.fn())
describe('ProjectStaging.vue'.() = > {
    const wrapper = getVue({
        component: ProjectStaging,
        mocks: {},cover: {
            stubs: ['router-link'.'router-view'],},callback(Vue) {
            Vue.use(elementUi);
            Vue.component(Tree.name, Tree)
            Vue.component(DefaultErrorPage.name, DefaultErrorPage)
        }
    })
    it('Is the default sort time?'.() = > {
        expect(wrapper.vm.sortRule).toBe('time')
    })
    it('projectList initializer is an array? '.() = > {
        expect(Array.isArray(wrapper.vm.projectList)).toBe(true)
    })
    it('isShowMore initial value is false? '.() = > {
        expect(Array.isArray(wrapper.vm.isShowMore)).toBe(false)
    })
    it('Do you have all the tabs on the page?'.() = > {
        expect(wrapper.html()).toBeTruthy()
    })
    it('Do you have all the tabs on the page?'.() = > {
        expect(wrapper.find('.letter-sort-icon')).toBeTruthy()
    })
    it('method'.() = > {
        wrapper.vm.getprojectList({})
        wrapper.vm['projectStaing/setStagingID']()
        wrapper.vm['projectStaing/setStagingID']()
        wrapper.vm.subList1([])
        wrapper.vm.subList1([0.1.2])
        wrapper.vm.subList2([])
        wrapper.vm.subList2([0.1.2])
        wrapper.vm.getprojectList({})
        wrapper.vm.handleSearch({})
        wrapper.vm.changeImageSrc('time'.1)
        wrapper.vm.changeImageSrc('time'.0)
        wrapper.vm.changeImageSrc('letter'.0)
        wrapper.vm.changeImageSrc('letter'.1)
        wrapper.vm.clickSort('time')
        wrapper.vm.inputLength('strjsdkahfks')
        wrapper.vm.inputLength('strjsdkahfkdskhfkdsakfjsdkljflkadsjfkljdslkfjlsdkjfkdsjalfkjdslkjflkdsjflkjsdklfjalkdsajflkjdsalfjsdalkjfdlsa')
        wrapper.vm.handleClick({index:1})
        wrapper.vm.handleClick({index:0})
        wrapper.vm.clickStaging()
        wrapper.vm.clickMore(false)
        wrapper.vm.clickMore()
    })
    it('data'.() = > {
        wrapper.vm.timeSrc
        wrapper.vm.letterSrc
        wrapper.vm.sortRule
        wrapper.vm.projectList
        wrapper.vm.activeNameIndex
        wrapper.vm.rules
        wrapper.vm.dataModel
        wrapper.vm.isShowMore
        wrapper.vm.searchObj
    })
})
Copy the code