tests fixed for clickedCount

This commit is contained in:
Moriz Wahl 2021-02-22 22:23:56 +01:00
parent f2d34cc815
commit 96066eae02
8 changed files with 140 additions and 129 deletions

View File

@ -25,6 +25,7 @@ describe('PostTeaser', () => {
disabled: false, disabled: false,
shoutedCount: 0, shoutedCount: 0,
commentsCount: 0, commentsCount: 0,
clickedCount: 0,
name: 'It is a post', name: 'It is a post',
author: { author: {
id: 'u1', id: 'u1',

View File

@ -28,6 +28,7 @@ export const post = {
shoutedCount: 5, shoutedCount: 5,
commentedCount: 39, commentedCount: 39,
followedByCount: 2, followedByCount: 2,
clickedCount: 42,
followedByCurrentUser: true, followedByCurrentUser: true,
location: null, location: null,
badges: [ badges: [

View File

@ -59,14 +59,14 @@
</template> </template>
<script> <script>
import UserTeaser from '~/components/UserTeaser/UserTeaser' import UserTeaser from '~/components/UserTeaser/UserTeaser'
import ContentMenu from '~/components/ContentMenu/ContentMenu' import ContentMenu from '~/components/ContentMenu/ContentMenu'
import HcRibbon from '~/components/Ribbon' import HcRibbon from '~/components/Ribbon'
import CounterIcon from '~/components/_new/generic/CounterIcon/CounterIcon' import CounterIcon from '~/components/_new/generic/CounterIcon/CounterIcon'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { postMenuModalsData, deletePostMutation } from '~/components/utils/PostHelpers' import { postMenuModalsData, deletePostMutation } from '~/components/utils/PostHelpers'
export default { export default {
name: 'PostTeaser', name: 'PostTeaser',
components: { components: {
UserTeaser, UserTeaser,
@ -136,12 +136,12 @@
this.$emit('unpinPost', post) this.$emit('unpinPost', post)
}, },
}, },
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.post-teaser, .post-teaser,
.post-teaser:hover, .post-teaser:hover,
.post-teaser:active { .post-teaser:active {
position: relative; position: relative;
display: block; display: block;
height: 100%; height: 100%;
@ -152,9 +152,9 @@
top: 50%; top: 50%;
right: -7px; right: -7px;
} }
} }
.post-teaser > .base-card { .post-teaser > .base-card {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
@ -197,5 +197,5 @@
.user-teaser { .user-teaser {
margin-bottom: $space-small; margin-bottom: $space-small;
} }
} }
</style> </style>

View File

@ -15,6 +15,7 @@ describe('SearchPost.vue', () => {
title: 'Post Title', title: 'Post Title',
commentsCount: 3, commentsCount: 3,
shoutedCount: 6, shoutedCount: 6,
clickedCount: 5,
createdAt: '23.08.2019', createdAt: '23.08.2019',
author: { author: {
name: 'Post Author', name: 'Post Author',

View File

@ -5,6 +5,7 @@
<span class="counts"> <span class="counts">
<counter-icon icon="comments" :count="option.commentsCount" soft /> <counter-icon icon="comments" :count="option.commentsCount" soft />
<counter-icon icon="bullhorn" :count="option.shoutedCount" soft /> <counter-icon icon="bullhorn" :count="option.shoutedCount" soft />
<counter-icon icon="eye" :count="option.clickedCount" soft />
</span> </span>
{{ option.author.name | truncate(32) }} - {{ option.createdAt | dateTime('dd.MM.yyyy') }} {{ option.author.name | truncate(32) }} - {{ option.createdAt | dateTime('dd.MM.yyyy') }}
</div> </div>

View File

@ -14,6 +14,7 @@ export const searchResults = [
value: 'User Post by Jenny', value: 'User Post by Jenny',
shoutedCount: 0, shoutedCount: 0,
commentsCount: 4, commentsCount: 4,
clickedCount: 8,
createdAt: '2019-11-13T03:03:16.155Z', createdAt: '2019-11-13T03:03:16.155Z',
author: { author: {
id: 'u3', id: 'u3',
@ -29,6 +30,7 @@ export const searchResults = [
value: 'Eum quos est molestiae enim magni consequuntur sed commodi eos.', value: 'Eum quos est molestiae enim magni consequuntur sed commodi eos.',
shoutedCount: 0, shoutedCount: 0,
commentsCount: 0, commentsCount: 0,
clickedCount: 9,
createdAt: '2019-11-13T03:00:45.478Z', createdAt: '2019-11-13T03:00:45.478Z',
author: { author: {
id: 'u6', id: 'u6',
@ -44,6 +46,7 @@ export const searchResults = [
value: 'This is post #7', value: 'This is post #7',
shoutedCount: 1, shoutedCount: 1,
commentsCount: 1, commentsCount: 1,
clickedCount: 1,
createdAt: '2019-11-13T03:00:23.098Z', createdAt: '2019-11-13T03:00:23.098Z',
author: { author: {
id: 'u6', id: 'u6',
@ -59,6 +62,7 @@ export const searchResults = [
value: 'This is post #12', value: 'This is post #12',
shoutedCount: 0, shoutedCount: 0,
commentsCount: 12, commentsCount: 12,
clickedCount: 14,
createdAt: '2019-11-13T03:00:23.098Z', createdAt: '2019-11-13T03:00:23.098Z',
author: { author: {
id: 'u6', id: 'u6',

View File

@ -12,6 +12,7 @@ export const searchQuery = gql`
...post ...post
commentsCount commentsCount
shoutedCount shoutedCount
clickedCount
author { author {
...user ...user
} }
@ -40,6 +41,7 @@ export const searchPosts = gql`
...tagsCategoriesAndPinned ...tagsCategoriesAndPinned
commentsCount commentsCount
shoutedCount shoutedCount
clickedCount
author { author {
...user ...user
} }

View File

@ -81,6 +81,7 @@ const helpers = {
slug: faker.lorem.slug(title), slug: faker.lorem.slug(title),
shoutedCount: faker.random.number(), shoutedCount: faker.random.number(),
commentsCount: faker.random.number(), commentsCount: faker.random.number(),
clickedCount: faker.random.number(),
} }
}) })
}, },