mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
test group profile page, a start
This commit is contained in:
parent
ad349e4ecd
commit
25c26ce158
@ -55,18 +55,18 @@ const seedBasicsAndClearAuthentication = async () => {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
neode.create('Category', {
|
|
||||||
id: 'cat9',
|
|
||||||
name: 'Democracy & Politics',
|
|
||||||
slug: 'democracy-politics',
|
|
||||||
icon: 'university',
|
|
||||||
}),
|
|
||||||
neode.create('Category', {
|
neode.create('Category', {
|
||||||
id: 'cat4',
|
id: 'cat4',
|
||||||
name: 'Environment & Nature',
|
name: 'Environment & Nature',
|
||||||
slug: 'environment-nature',
|
slug: 'environment-nature',
|
||||||
icon: 'tree',
|
icon: 'tree',
|
||||||
}),
|
}),
|
||||||
|
neode.create('Category', {
|
||||||
|
id: 'cat9',
|
||||||
|
name: 'Democracy & Politics',
|
||||||
|
slug: 'democracy-politics',
|
||||||
|
icon: 'university',
|
||||||
|
}),
|
||||||
neode.create('Category', {
|
neode.create('Category', {
|
||||||
id: 'cat15',
|
id: 'cat15',
|
||||||
name: 'Consumption & Sustainability',
|
name: 'Consumption & Sustainability',
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<base-button
|
<base-button
|
||||||
class="track-button"
|
class="join-leave-button"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:loading="localLoading"
|
:loading="localLoading"
|
||||||
:icon="icon"
|
:icon="icon"
|
||||||
@ -129,7 +129,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.track-button {
|
.join-leave-button {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="avatar-uploader">
|
||||||
<vue-dropzone
|
<vue-dropzone
|
||||||
id="customdropzone"
|
id="customdropzone"
|
||||||
:key="avatarUrl"
|
:key="avatarUrl"
|
||||||
|
|||||||
@ -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')
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
1199
webapp/pages/group/_id/_slug.spec.js
Normal file
1199
webapp/pages/group/_id/_slug.spec.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div v-if="isGroupVisible">
|
||||||
<ds-space />
|
<ds-space />
|
||||||
<ds-flex v-if="group" :width="{ base: '100%' }" gutter="base">
|
<ds-flex v-if="group" :width="{ base: '100%' }" gutter="base">
|
||||||
<ds-flex-item :width="{ base: '100%', sm: 2, md: 2, lg: 1 }">
|
<ds-flex-item :width="{ base: '100%', sm: 2, md: 2, lg: 1 }">
|
||||||
@ -41,7 +41,7 @@
|
|||||||
</ds-text>
|
</ds-text>
|
||||||
<!-- Group location -->
|
<!-- Group location -->
|
||||||
<ds-text v-if="group && group.location" align="center" color="soft" size="small">
|
<ds-text v-if="group && group.location" align="center" color="soft" size="small">
|
||||||
<base-icon name="map-marker" />
|
<base-icon name="map-marker" data-test="map-marker" />
|
||||||
{{ group && group.location ? group.location.name : '' }}
|
{{ group && group.location ? group.location.name : '' }}
|
||||||
</ds-text>
|
</ds-text>
|
||||||
<!-- Group created at -->
|
<!-- Group created at -->
|
||||||
@ -196,7 +196,7 @@
|
|||||||
</ds-heading>
|
</ds-heading>
|
||||||
<!-- Group members list -->
|
<!-- Group members list -->
|
||||||
<profile-list
|
<profile-list
|
||||||
:uniqueName="`groupMembersFilter`"
|
:uniqueName="'groupMembersFilter'"
|
||||||
:title="$t('group.membersListTitle')"
|
:title="$t('group.membersListTitle')"
|
||||||
:titleNobody="
|
:titleNobody="
|
||||||
!isAllowedSeeingGroupMembers
|
!isAllowedSeeingGroupMembers
|
||||||
@ -393,7 +393,7 @@ export default {
|
|||||||
return this.$store.getters['auth/user']
|
return this.$store.getters['auth/user']
|
||||||
},
|
},
|
||||||
group() {
|
group() {
|
||||||
return this.Group[0] ? this.Group[0] : {}
|
return this.Group && this.Group[0] ? this.Group[0] : {}
|
||||||
},
|
},
|
||||||
groupName() {
|
groupName() {
|
||||||
const { name } = this.group || {}
|
const { name } = this.group || {}
|
||||||
@ -404,6 +404,7 @@ export default {
|
|||||||
return slug && `@${slug}`
|
return slug && `@${slug}`
|
||||||
},
|
},
|
||||||
groupDescriptionExcerpt() {
|
groupDescriptionExcerpt() {
|
||||||
|
// Wolle: console.log('groupDescriptionExcerpt: ', this.group ? this.$filters.removeLinks(this.group.descriptionExcerpt) : '')
|
||||||
return this.group ? this.$filters.removeLinks(this.group.descriptionExcerpt) : ''
|
return this.group ? this.$filters.removeLinks(this.group.descriptionExcerpt) : ''
|
||||||
},
|
},
|
||||||
isGroupOwner() {
|
isGroupOwner() {
|
||||||
@ -415,6 +416,9 @@ export default {
|
|||||||
isGroupMemberNonePending() {
|
isGroupMemberNonePending() {
|
||||||
return this.group ? ['usual', 'admin', 'owner'].includes(this.group.myRole) : false
|
return this.group ? ['usual', 'admin', 'owner'].includes(this.group.myRole) : false
|
||||||
},
|
},
|
||||||
|
isGroupVisible() {
|
||||||
|
return this.group && !(this.group.groupType === 'hidden' && !this.isGroupMemberNonePending)
|
||||||
|
},
|
||||||
groupMembers() {
|
groupMembers() {
|
||||||
return this.GroupMembers ? this.GroupMembers : []
|
return this.GroupMembers ? this.GroupMembers : []
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user