mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Remove testing of group profile for now
This commit is contained in:
parent
ee770aa204
commit
99b1a164a8
95
webapp/pages/group/_id/_slug.___spec.js
Normal file
95
webapp/pages/group/_id/_slug.___spec.js
Normal file
@ -0,0 +1,95 @@
|
||||
// import { config, mount } from '@vue/test-utils'
|
||||
// import ProfileSlug from './_slug.vue'
|
||||
|
||||
// const localVue = global.localVue
|
||||
|
||||
// localVue.filter('date', (d) => d)
|
||||
|
||||
// config.stubs['client-only'] = '<span><slot /></span>'
|
||||
// config.stubs['v-popover'] = '<span><slot /></span>'
|
||||
// config.stubs['nuxt-link'] = '<span><slot /></span>'
|
||||
// config.stubs['infinite-loading'] = '<span><slot /></span>'
|
||||
// config.stubs['follow-list'] = '<span><slot /></span>'
|
||||
|
||||
// describe('ProfileSlug', () => {
|
||||
// let wrapper
|
||||
// let Wrapper
|
||||
// let mocks
|
||||
|
||||
// beforeEach(() => {
|
||||
// mocks = {
|
||||
// post: {
|
||||
// id: 'p23',
|
||||
// name: 'It is a post',
|
||||
// },
|
||||
// $t: jest.fn(),
|
||||
// // If you're mocking router, then don't use VueRouter with localVue: https://vue-test-utils.vuejs.org/guides/using-with-vue-router.html
|
||||
// $route: {
|
||||
// params: {
|
||||
// id: '4711',
|
||||
// slug: 'john-doe',
|
||||
// },
|
||||
// },
|
||||
// $router: {
|
||||
// history: {
|
||||
// push: jest.fn(),
|
||||
// },
|
||||
// },
|
||||
// $toast: {
|
||||
// success: jest.fn(),
|
||||
// error: jest.fn(),
|
||||
// },
|
||||
// $apollo: {
|
||||
// loading: false,
|
||||
// mutate: jest.fn().mockResolvedValue(),
|
||||
// },
|
||||
// }
|
||||
// })
|
||||
|
||||
// describe('mount', () => {
|
||||
// Wrapper = () => {
|
||||
// return mount(ProfileSlug, {
|
||||
// mocks,
|
||||
// localVue,
|
||||
// })
|
||||
// }
|
||||
|
||||
// describe('given an authenticated user', () => {
|
||||
// beforeEach(() => {
|
||||
// mocks.$filters = {
|
||||
// removeLinks: (c) => c,
|
||||
// truncate: (a) => a,
|
||||
// }
|
||||
// mocks.$store = {
|
||||
// getters: {
|
||||
// 'auth/isModerator': () => false,
|
||||
// 'auth/user': {
|
||||
// id: 'u23',
|
||||
// },
|
||||
// },
|
||||
// }
|
||||
// })
|
||||
|
||||
// describe('given a user for the profile', () => {
|
||||
// beforeEach(() => {
|
||||
// wrapper = Wrapper()
|
||||
// wrapper.setData({
|
||||
// User: [
|
||||
// {
|
||||
// id: 'u3',
|
||||
// name: 'Bob the builder',
|
||||
// contributionsCount: 6,
|
||||
// shoutedCount: 7,
|
||||
// commentedCount: 8,
|
||||
// },
|
||||
// ],
|
||||
// })
|
||||
// })
|
||||
|
||||
// it('displays name of the user', () => {
|
||||
// expect(wrapper.text()).toContain('Bob the builder')
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
@ -1,95 +0,0 @@
|
||||
import { config, mount } from '@vue/test-utils'
|
||||
import ProfileSlug from './_slug.vue'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
localVue.filter('date', (d) => d)
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
config.stubs['v-popover'] = '<span><slot /></span>'
|
||||
config.stubs['nuxt-link'] = '<span><slot /></span>'
|
||||
config.stubs['infinite-loading'] = '<span><slot /></span>'
|
||||
config.stubs['follow-list'] = '<span><slot /></span>'
|
||||
|
||||
describe('ProfileSlug', () => {
|
||||
let wrapper
|
||||
let Wrapper
|
||||
let mocks
|
||||
|
||||
beforeEach(() => {
|
||||
mocks = {
|
||||
post: {
|
||||
id: 'p23',
|
||||
name: 'It is a post',
|
||||
},
|
||||
$t: jest.fn(),
|
||||
// If you're mocking router, then don't use VueRouter with localVue: https://vue-test-utils.vuejs.org/guides/using-with-vue-router.html
|
||||
$route: {
|
||||
params: {
|
||||
id: '4711',
|
||||
slug: 'john-doe',
|
||||
},
|
||||
},
|
||||
$router: {
|
||||
history: {
|
||||
push: jest.fn(),
|
||||
},
|
||||
},
|
||||
$toast: {
|
||||
success: jest.fn(),
|
||||
error: jest.fn(),
|
||||
},
|
||||
$apollo: {
|
||||
loading: false,
|
||||
mutate: jest.fn().mockResolvedValue(),
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
describe('mount', () => {
|
||||
Wrapper = () => {
|
||||
return mount(ProfileSlug, {
|
||||
mocks,
|
||||
localVue,
|
||||
})
|
||||
}
|
||||
|
||||
describe('given an authenticated user', () => {
|
||||
beforeEach(() => {
|
||||
mocks.$filters = {
|
||||
removeLinks: (c) => c,
|
||||
truncate: (a) => a,
|
||||
}
|
||||
mocks.$store = {
|
||||
getters: {
|
||||
'auth/isModerator': () => false,
|
||||
'auth/user': {
|
||||
id: 'u23',
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
describe('given a user for the profile', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
wrapper.setData({
|
||||
User: [
|
||||
{
|
||||
id: 'u3',
|
||||
name: 'Bob the builder',
|
||||
contributionsCount: 6,
|
||||
shoutedCount: 7,
|
||||
commentedCount: 8,
|
||||
},
|
||||
],
|
||||
})
|
||||
})
|
||||
|
||||
it('displays name of the user', () => {
|
||||
expect(wrapper.text()).toContain('Bob the builder')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user