mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
set up global localVue
by setting up localVue with all required plugins (such as styleguide and vuex) in a separate testSetup file we can avoid doing this individually in all component tests the testSetup is executed before each test suite, so each test file gets a fresh instance of localVue
This commit is contained in:
parent
90d4b361e8
commit
77f4810ddc
@ -1,6 +1,7 @@
|
||||
{
|
||||
"plugins": [
|
||||
"@babel/plugin-syntax-dynamic-import"
|
||||
"@babel/plugin-syntax-dynamic-import",
|
||||
"transform-require-context"
|
||||
],
|
||||
"presets": [
|
||||
[
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Avatar from './Avatar.vue'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('Avatar.vue', () => {
|
||||
let propsData = {}
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import { config, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, mount } from '@vue/test-utils'
|
||||
import Vuex from 'vuex'
|
||||
import VTooltip from 'v-tooltip'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import AvatarMenu from './AvatarMenu.vue'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Filters)
|
||||
localVue.use(VTooltip)
|
||||
const localVue = global.localVue
|
||||
|
||||
config.stubs['nuxt-link'] = '<span><slot /></span>'
|
||||
config.stubs['router-link'] = '<span><slot /></span>'
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import CategoriesSelect from './CategoriesSelect'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('CategoriesSelect.vue', () => {
|
||||
let wrapper
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
|
||||
import Category from './index'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('Category', () => {
|
||||
let icon
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
import { config, shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, shallowMount } from '@vue/test-utils'
|
||||
import Comment from './Comment.vue'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import CommentForm from './CommentForm'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
import MutationObserver from 'mutation-observer'
|
||||
|
||||
global.MutationObserver = MutationObserver
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('CommentForm.vue', () => {
|
||||
let mocks
|
||||
|
||||
@ -1,14 +1,9 @@
|
||||
import { config, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, mount } from '@vue/test-utils'
|
||||
import CommentList from './CommentList'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Filters)
|
||||
localVue.filter('truncate', string => string)
|
||||
|
||||
config.stubs['v-popover'] = '<span><slot /></span>'
|
||||
|
||||
@ -1,20 +1,16 @@
|
||||
import { config, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, mount } from '@vue/test-utils'
|
||||
import ContributionForm from './ContributionForm.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
import Vuex from 'vuex'
|
||||
import PostMutations from '~/graphql/PostMutations.js'
|
||||
import CategoriesSelect from '~/components/CategoriesSelect/CategoriesSelect'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
|
||||
import TeaserImage from '~/components/TeaserImage/TeaserImage'
|
||||
import MutationObserver from 'mutation-observer'
|
||||
|
||||
global.MutationObserver = MutationObserver
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
const localVue = global.localVue
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
config.stubs['nuxt-link'] = '<span><slot /></span>'
|
||||
|
||||
@ -1,12 +1,9 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import DeleteData from './DeleteData.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
import Vuex from 'vuex'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('DeleteData.vue', () => {
|
||||
let mocks
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { mount } from '@vue/test-utils'
|
||||
|
||||
import DonationInfo from './DonationInfo.vue'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
const mockDate = new Date(2019, 11, 6)
|
||||
global.Date = jest.fn(() => mockDate)
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import VTooltip from 'v-tooltip'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { mount } from '@vue/test-utils'
|
||||
|
||||
import DropdownFilter from './DropdownFilter.vue'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(VTooltip)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('DropdownFilter.vue', () => {
|
||||
let propsData, wrapper, mocks
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Editor from './Editor'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
import MutationObserver from 'mutation-observer'
|
||||
import Vue from 'vue'
|
||||
|
||||
global.MutationObserver = MutationObserver
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('Editor.vue', () => {
|
||||
let wrapper
|
||||
|
||||
@ -1,14 +1,9 @@
|
||||
import { shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
|
||||
import Embed from './Embed'
|
||||
|
||||
let Wrapper, propsData, component
|
||||
const someUrl = 'https://www.youtube.com/watch?v=qkdXAtO40Fo'
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
|
||||
describe('Embed.vue', () => {
|
||||
beforeEach(() => {
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
import EmbedComponent from './EmbedComponent'
|
||||
|
||||
let wrapper, propsData, getters, mocks
|
||||
const someUrl = 'https://www.youtube.com/watch?v=qkdXAtO40Fo'
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('EmbedComponent.vue', () => {
|
||||
const Wrapper = () => {
|
||||
|
||||
@ -1,13 +1,10 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Emotions from './Emotions.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
import Vuex from 'vuex'
|
||||
import PostMutations from '~/graphql/PostMutations.js'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Vuex)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('Emotions.vue', () => {
|
||||
let wrapper
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
|
||||
import Empty from './Empty.vue'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('Empty.vue', () => {
|
||||
let propsData, wrapper
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import EnterNonce from './EnterNonce.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('EnterNonce ', () => {
|
||||
let wrapper
|
||||
|
||||
@ -1,12 +1,7 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import FilterMenu from './FilterMenu.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import VTooltip from 'v-tooltip'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(VTooltip)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('FilterMenu.vue', () => {
|
||||
let wrapper
|
||||
|
||||
@ -1,16 +1,11 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import VTooltip from 'v-tooltip'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { mount } from '@vue/test-utils'
|
||||
|
||||
import Vuex from 'vuex'
|
||||
import FilterPosts from './FilterPosts.vue'
|
||||
import locales from '~/locales'
|
||||
import orderBy from 'lodash/orderBy'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(VTooltip)
|
||||
localVue.use(Vuex)
|
||||
const localVue = global.localVue
|
||||
|
||||
let mutations
|
||||
let getters
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { config, shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { config, shallowMount } from '@vue/test-utils'
|
||||
|
||||
import Hashtag from './Hashtag'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
config.stubs['nuxt-link'] = '<span><slot /></span>'
|
||||
|
||||
|
||||
@ -1,14 +1,9 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import VTooltip from 'v-tooltip'
|
||||
import { mount } from '@vue/test-utils'
|
||||
|
||||
import LocaleSwitch from './LocaleSwitch.vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(VTooltip)
|
||||
localVue.use(Vuex)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('LocaleSwitch.vue', () => {
|
||||
let wrapper, mocks, computed, deutschLanguageItem, getters
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { mount } from '@vue/test-utils'
|
||||
|
||||
import MasonryGrid from './MasonryGrid'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('MasonryGrid', () => {
|
||||
let wrapper
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { config, shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { config, shallowMount } from '@vue/test-utils'
|
||||
|
||||
import MasonryGridItem from './MasonryGridItem'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
config.stubs['ds-grid-item'] = '<span><slot /></span>'
|
||||
|
||||
|
||||
@ -1,16 +1,12 @@
|
||||
import { shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
import Modal from './Modal.vue'
|
||||
import ConfirmModal from './Modal/ConfirmModal.vue'
|
||||
import DisableModal from './Modal/DisableModal.vue'
|
||||
import ReportModal from './Modal/ReportModal.vue'
|
||||
import Vuex from 'vuex'
|
||||
import { getters, mutations } from '../store/modal'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('Modal.vue', () => {
|
||||
let wrapper
|
||||
|
||||
@ -1,13 +1,10 @@
|
||||
import { config, shallowMount, mount, createLocalVue } from '@vue/test-utils'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { config, shallowMount, mount } from '@vue/test-utils'
|
||||
|
||||
import ConfirmModal from './ConfirmModal.vue'
|
||||
import { postMenuModalsData } from '~/components/utils/PostHelpers'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
config.stubs['sweetalert-icon'] = '<span><slot /></span>'
|
||||
|
||||
describe('ConfirmModal.vue', () => {
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
import { shallowMount, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { shallowMount, mount } from '@vue/test-utils'
|
||||
import DisableModal from './DisableModal.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('DisableModal.vue', () => {
|
||||
let mocks
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
import { config, shallowMount, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, shallowMount, mount } from '@vue/test-utils'
|
||||
import ReportModal from './ReportModal.vue'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
config.stubs['sweetalert-icon'] = '<span><slot /></span>'
|
||||
|
||||
describe('ReportModal.vue', () => {
|
||||
|
||||
@ -1,14 +1,9 @@
|
||||
import { config, mount, createLocalVue, RouterLinkStub } from '@vue/test-utils'
|
||||
import { config, mount, RouterLinkStub } from '@vue/test-utils'
|
||||
import Notification from './Notification.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
|
||||
import Vuex from 'vuex'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
const localVue = global.localVue
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
|
||||
|
||||
@ -1,16 +1,12 @@
|
||||
import { config, shallowMount, mount, createLocalVue, RouterLinkStub } from '@vue/test-utils'
|
||||
import { config, shallowMount, mount, RouterLinkStub } from '@vue/test-utils'
|
||||
import NotificationList from './NotificationList'
|
||||
import Notification from '../Notification/Notification'
|
||||
import Vuex from 'vuex'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
import { notifications } from '~/components/utils/Notifications'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
localVue.filter('truncate', string => string)
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
|
||||
@ -1,13 +1,8 @@
|
||||
import { config, shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, shallowMount } from '@vue/test-utils'
|
||||
import NotificationMenu from './NotificationMenu'
|
||||
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
const localVue = global.localVue
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
localVue.filter('truncate', string => string)
|
||||
|
||||
config.stubs['dropdown'] = '<span class="dropdown"><slot /></span>'
|
||||
|
||||
@ -1,16 +1,11 @@
|
||||
import { config, mount, createLocalVue, RouterLinkStub } from '@vue/test-utils'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import VTooltip from 'v-tooltip'
|
||||
import { config, mount, RouterLinkStub } from '@vue/test-utils'
|
||||
|
||||
import Vuex from 'vuex'
|
||||
import NotificationsTable from './NotificationsTable'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
import { notifications } from '~/components/utils/Notifications'
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
localVue.use(VTooltip)
|
||||
localVue.use(Vuex)
|
||||
import { notifications } from '~/components/utils/Notifications'
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.filter('truncate', string => string)
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { mount } from '@vue/test-utils'
|
||||
|
||||
import Paginate from './Paginate'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('Paginate.vue', () => {
|
||||
let propsData, wrapper, Wrapper, nextButton, backButton
|
||||
|
||||
@ -1,12 +1,7 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ChangePassword from './Change.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('ChangePassword.vue', () => {
|
||||
let mocks
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
import { config, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, mount } from '@vue/test-utils'
|
||||
import ChangePassword from './ChangePassword'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.use(Styleguide)
|
||||
config.stubs['sweetalert-icon'] = '<span><slot /></span>'
|
||||
|
||||
describe('ChangePassword ', () => {
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
import { config, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, mount } from '@vue/test-utils'
|
||||
import Request from './Request'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.use(Styleguide)
|
||||
config.stubs['sweetalert-icon'] = '<span><slot /></span>'
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
config.stubs['nuxt-link'] = '<span><slot /></span>'
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
import { config, shallowMount, mount, createLocalVue, RouterLinkStub } from '@vue/test-utils'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import { config, shallowMount, mount, RouterLinkStub } from '@vue/test-utils'
|
||||
|
||||
import Vuex from 'vuex'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
|
||||
import PostCard from './PostCard.vue'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
const localVue = global.localVue
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
config.stubs['v-popover'] = '<span><slot /></span>'
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
import { config, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, mount } from '@vue/test-utils'
|
||||
import { VERSION } from '~/constants/terms-and-conditions-version.js'
|
||||
import CreateUserAccount from './CreateUserAccount'
|
||||
import { SignupVerificationMutation } from '~/graphql/Registration.js'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.use(Styleguide)
|
||||
config.stubs['sweetalert-icon'] = '<span><slot /></span>'
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
config.stubs['nuxt-link'] = '<span><slot /></span>'
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
import { config, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, mount } from '@vue/test-utils'
|
||||
import Signup, { SignupMutation, SignupByInvitationMutation } from './Signup'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.use(Styleguide)
|
||||
config.stubs['sweetalert-icon'] = '<span><slot /></span>'
|
||||
|
||||
describe('Signup', () => {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
import RelativeDateTime from './'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('RelativeDateTime', () => {
|
||||
let mocks
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
import { shallowMount, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { shallowMount, mount } from '@vue/test-utils'
|
||||
import ReleaseModal from './ReleaseModal.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('ReleaseModal.vue', () => {
|
||||
let mocks
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
import Ribbon from './index'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('Ribbon', () => {
|
||||
let text
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import SearchInput from './SearchInput.vue'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.filter('truncate', () => 'truncated string')
|
||||
localVue.filter('dateTime', () => Date.now)
|
||||
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import TeaserImage from './TeaserImage.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('TeaserImage.vue', () => {
|
||||
let wrapper
|
||||
|
||||
@ -1,12 +1,7 @@
|
||||
import { shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
import Upload from '.'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('Upload', () => {
|
||||
let wrapper
|
||||
|
||||
@ -1,19 +1,10 @@
|
||||
import { mount, createLocalVue, RouterLinkStub } from '@vue/test-utils'
|
||||
import { mount, RouterLinkStub } from '@vue/test-utils'
|
||||
import User from './User.vue'
|
||||
import Vuex from 'vuex'
|
||||
import VTooltip from 'v-tooltip'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
const filter = jest.fn(str => str)
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(VTooltip)
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
|
||||
localVue.filter('truncate', filter)
|
||||
|
||||
describe('User', () => {
|
||||
|
||||
@ -47,6 +47,9 @@
|
||||
"^~/(.*)$": "<rootDir>/$1",
|
||||
"\\.(css|less)$": "identity-obj-proxy"
|
||||
},
|
||||
"setupFiles": [
|
||||
"<rootDir>/testSetup.js"
|
||||
],
|
||||
"testMatch": [
|
||||
"**/?(*.)+(spec|test).js?(x)"
|
||||
]
|
||||
@ -62,6 +65,7 @@
|
||||
"accounting": "~0.4.1",
|
||||
"apollo-cache-inmemory": "~1.6.3",
|
||||
"apollo-client": "~2.6.4",
|
||||
"babel-plugin-transform-require-context": "^0.1.1",
|
||||
"cookie-universal-nuxt": "~2.0.18",
|
||||
"cropperjs": "^1.5.5",
|
||||
"cross-env": "~6.0.3",
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import AdminIndexPage from './index.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
import VueApollo from 'vue-apollo'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(VueApollo)
|
||||
|
||||
describe('admin/index.vue', () => {
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Users from './users.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('Users', () => {
|
||||
let wrapper
|
||||
|
||||
@ -1,19 +1,10 @@
|
||||
import { config, shallowMount, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, shallowMount, mount } from '@vue/test-utils'
|
||||
import PostIndex from './index.vue'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
import VTooltip from 'v-tooltip'
|
||||
|
||||
import FilterMenu from '~/components/FilterMenu/FilterMenu'
|
||||
import InfiniteScroll from '~/plugins/vue-infinite-scroll'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
localVue.use(VTooltip)
|
||||
localVue.use(InfiniteScroll)
|
||||
const localVue = global.localVue
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
config.stubs['router-link'] = '<span><slot /></span>'
|
||||
|
||||
@ -1,15 +1,11 @@
|
||||
import { config, shallowMount, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, shallowMount, mount } from '@vue/test-utils'
|
||||
import NotificationsPage from './index.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import VTooltip from 'v-tooltip'
|
||||
|
||||
import DropdownFilter from '~/components/DropdownFilter/DropdownFilter'
|
||||
import NotificationsTable from '~/components/NotificationsTable/NotificationsTable'
|
||||
import Paginate from '~/components/Paginate/Paginate'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(VTooltip)
|
||||
const localVue = global.localVue
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
|
||||
|
||||
@ -1,14 +1,8 @@
|
||||
import { config, shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, shallowMount } from '@vue/test-utils'
|
||||
import PostSlug from './index.vue'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
const localVue = global.localVue
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
|
||||
|
||||
@ -1,16 +1,8 @@
|
||||
import { config, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, mount } from '@vue/test-utils'
|
||||
import ProfileSlug from './_slug.vue'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
import InfiniteScroll from '~/plugins/vue-infinite-scroll'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
localVue.use(InfiniteScroll)
|
||||
localVue.filter('date', d => d)
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import index from './index.vue'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('index.vue', () => {
|
||||
let store
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import EnterNoncePage from './enter-nonce.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('EnterNoncePage', () => {
|
||||
let mocks
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
import { config, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, mount } from '@vue/test-utils'
|
||||
import EmailSettingsIndexPage from './index.vue'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
config.stubs['sweetalert-icon'] = '<span><slot /></span>'
|
||||
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
import { config, mount, createLocalVue } from '@vue/test-utils'
|
||||
import { config, mount } from '@vue/test-utils'
|
||||
import EmailVerifyPage from './verify.vue'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
const localVue = global.localVue
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
config.stubs['sweetalert-icon'] = '<span><slot /></span>'
|
||||
|
||||
@ -1,15 +1,9 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import flushPromises from 'flush-promises'
|
||||
import MySocialMedia from './my-social-media.vue'
|
||||
import Vuex from 'vuex'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('my-social-media.vue', () => {
|
||||
let wrapper
|
||||
|
||||
16
webapp/testSetup.js
Normal file
16
webapp/testSetup.js
Normal file
@ -0,0 +1,16 @@
|
||||
import { createLocalVue } from '@vue/test-utils'
|
||||
import Vuex from 'vuex'
|
||||
import VTooltip from 'v-tooltip'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import BaseComponents from '~/plugins/base-components'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
import InfiniteScroll from '~/plugins/vue-infinite-scroll'
|
||||
|
||||
global.localVue = createLocalVue()
|
||||
|
||||
global.localVue.use(Vuex)
|
||||
global.localVue.use(VTooltip)
|
||||
global.localVue.use(Styleguide)
|
||||
global.localVue.use(BaseComponents)
|
||||
global.localVue.use(Filters)
|
||||
global.localVue.use(InfiniteScroll)
|
||||
@ -867,7 +867,7 @@
|
||||
dependencies:
|
||||
regenerator-runtime "^0.13.2"
|
||||
|
||||
"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4", "@babel/template@^7.7.0":
|
||||
"@babel/template@7", "@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4", "@babel/template@^7.7.0":
|
||||
version "7.7.0"
|
||||
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.0.tgz#4fadc1b8e734d97f56de39c77de76f2562e597d0"
|
||||
integrity sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==
|
||||
@ -4562,6 +4562,13 @@ babel-plugin-transform-remove-undefined@^0.5.0:
|
||||
dependencies:
|
||||
babel-helper-evaluate-path "^0.5.0"
|
||||
|
||||
babel-plugin-transform-require-context@^0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/babel-plugin-transform-require-context/-/babel-plugin-transform-require-context-0.1.1.tgz#319b545ca83080b5062776b46cc9b8b346fea9a6"
|
||||
integrity sha512-4ceqYOtzgmq4/QsB8dP7pUrUOCjY/jrRYdt7YkIOWHxtGDQbcf6YZDyLCiPQf6KsEIcIbSQiTRXOsbLiuJfgNQ==
|
||||
dependencies:
|
||||
"@babel/template" "7"
|
||||
|
||||
babel-plugin-transform-simplify-comparison-operators@^6.9.4:
|
||||
version "6.9.4"
|
||||
resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9"
|
||||
@ -14268,6 +14275,11 @@ serve-static@1.14.1, serve-static@^1.14.1:
|
||||
version "1.14.1"
|
||||
resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9"
|
||||
integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==
|
||||
dependencies:
|
||||
encodeurl "~1.0.2"
|
||||
escape-html "~1.0.3"
|
||||
parseurl "~1.3.3"
|
||||
send "0.17.1"
|
||||
|
||||
server-destroy@^1.0.1:
|
||||
version "1.0.1"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user