Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import LoginForm from './LoginForm.vue'
import Styleguide from '@human-connection/styleguide'
import Vuex from 'vuex'
import { config, mount, createLocalVue } from '@vue/test-utils'
const localVue = createLocalVue()
localVue.use(Vuex)
localVue.use(Styleguide)
config.stubs['nuxt-link'] = '<span></span>'
config.stubs['locale-switch'] = '<span></span>'
config.stubs['client-only'] = '<span></span>'
describe('LoginForm', () => {
let mocks
let propsData
let storeMocks
beforeEach(() => {
propsData = {}
})
describe('mount', () => {
const Wrapper = () => {
storeMocks = {
getters: {
'auth/pending': () => false,
import { config, shallowMount, mount } from '@vue/test-utils'
import ReportModal from './ReportModal.vue'
const localVue = global.localVue
config.stubs['sweetalert-icon'] = '<span></span>'
describe('ReportModal.vue', () => {
let wrapper
let propsData
let mocks
beforeEach(() => {
propsData = {
type: 'contribution',
id: 'c43',
}
mocks = {
$t: jest.fn(a => a),
$filters: {
truncate: a => a,
},
import { config, shallowMount, mount } from '@vue/test-utils'
import ConfirmModal from './ConfirmModal.vue'
import { postMenuModalsData } from '~/components/utils/PostHelpers'
const localVue = global.localVue
config.stubs['sweetalert-icon'] = '<span></span>'
describe('ConfirmModal.vue', () => {
let Wrapper
let wrapper
let propsData
let mocks
const postName = 'It is a post'
const confirmCallback = jest.fn()
const cancelCallback = jest.fn()
beforeEach(() => {
propsData = {
type: 'contribution',
id: 'p23',
name: postName,
modalData: postMenuModalsData(postName, confirmCallback, cancelCallback).delete,
import { config, mount, RouterLinkStub } from '@vue/test-utils'
import Notification from './Notification.vue'
import Vuex from 'vuex'
const localVue = global.localVue
config.stubs['client-only'] = '<span></span>'
describe('Notification', () => {
let stubs
let getters
let mocks
let propsData
let wrapper
beforeEach(() => {
propsData = {}
mocks = {
$t: key => key,
}
stubs = {
NuxtLink: RouterLinkStub,
}
getters = {
import { config, mount, RouterLinkStub } from '@vue/test-utils'
import Vuex from 'vuex'
import ReportRow from './ReportRow.vue'
import BaseIcon from '~/components/_new/generic/BaseIcon/BaseIcon'
import { reports } from '~/components/features/ReportList/ReportList.story.js'
const localVue = global.localVue
config.stubs['client-only'] = '<span></span>'
describe('ReportRow', () => {
let propsData, mocks, stubs, getters, wrapper
beforeEach(() => {
propsData = {}
mocks = {
$t: jest.fn(string => string),
}
stubs = {
NuxtLink: RouterLinkStub,
}
getters = {
'auth/user': () => {
return { slug: 'awesome-user' }
},
import { config, mount, RouterLinkStub } from '@vue/test-utils'
import Vuex from 'vuex'
import NotificationsTable from './NotificationsTable'
import { notifications } from '~/components/utils/Notifications'
const localVue = global.localVue
localVue.filter('truncate', string => string)
config.stubs['client-only'] = '<span></span>'
describe('NotificationsTable.vue', () => {
let wrapper, mocks, propsData, stubs
const postNotification = notifications[0]
const commentNotification = notifications[1]
beforeEach(() => {
mocks = {
$t: jest.fn(string => string),
}
stubs = {
NuxtLink: RouterLinkStub,
}
propsData = {}
})
import { config, shallowMount } from '@vue/test-utils'
import Comment from './Comment.vue'
import Vuex from 'vuex'
const localVue = global.localVue
config.stubs['client-only'] = '<span></span>'
describe('Comment.vue', () => {
let propsData
let mocks
let getters
let wrapper
let Wrapper
beforeEach(() => {
propsData = {}
mocks = {
$t: jest.fn(),
$toast: {
success: jest.fn(),
error: jest.fn(),
},
import { config, shallowMount, mount, RouterLinkStub } from '@vue/test-utils'
import Vuex from 'vuex'
import PostCard from './PostCard.vue'
const localVue = global.localVue
config.stubs['client-only'] = '<span></span>'
config.stubs['v-popover'] = '<span></span>'
describe('PostCard', () => {
let store
let stubs
let mocks
let propsData
let getters
let Wrapper
let wrapper
beforeEach(() => {
propsData = {
post: {
id: 'p23',
name: 'It is a post',
import { config, mount, createLocalVue } from '@vue/test-utils'
import Vuex from 'vuex'
import VTooltip from 'v-tooltip'
import Styleguide from '@human-connection/styleguide'
import ContentMenu from './ContentMenu.vue'
const localVue = createLocalVue()
localVue.use(Styleguide)
localVue.use(VTooltip)
localVue.use(Vuex)
config.stubs['router-link'] = '<span></span>'
let getters, mutations, mocks, menuToggle, openModalSpy
describe('ContentMenu.vue', () => {
beforeEach(() => {
mocks = {
$t: jest.fn(str => str),
$i18n: {
locale: () => 'en',
},
$router: {
push: jest.fn(),
},
}
})
import { config, shallowMount, mount } from '@vue/test-utils'
import PostIndex from './index.vue'
import Vuex from 'vuex'
import FilterMenu from '~/components/FilterMenu/FilterMenu'
const localVue = global.localVue
config.stubs['client-only'] = '<span></span>'
config.stubs['router-link'] = '<span></span>'
config.stubs['nuxt-link'] = '<span></span>'
config.stubs['infinite-loading'] = '<span></span>'
describe('PostIndex', () => {
let wrapper
let Wrapper
let store
let mocks
let mutations
beforeEach(() => {
mutations = {
'posts/SELECT_ORDER': jest.fn(),
}
store = new Vuex.Store({
getters: {
'posts/filter': () => ({}),