diff --git a/webapp/pages/group/_id/_slug.___spec.js b/webapp/pages/group/_id/_slug.___spec.js new file mode 100644 index 000000000..f83c0f937 --- /dev/null +++ b/webapp/pages/group/_id/_slug.___spec.js @@ -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'] = '' +// config.stubs['v-popover'] = '' +// config.stubs['nuxt-link'] = '' +// config.stubs['infinite-loading'] = '' +// config.stubs['follow-list'] = '' + +// 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') +// }) +// }) +// }) +// }) +// }) diff --git a/webapp/pages/group/_id/_slug.spec.js b/webapp/pages/group/_id/_slug.spec.js deleted file mode 100644 index 477174485..000000000 --- a/webapp/pages/group/_id/_slug.spec.js +++ /dev/null @@ -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'] = '' -config.stubs['v-popover'] = '' -config.stubs['nuxt-link'] = '' -config.stubs['infinite-loading'] = '' -config.stubs['follow-list'] = '' - -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') - }) - }) - }) - }) -})