diff --git a/src/pages/Question/QuestionPage.tsx b/src/pages/Question/QuestionPage.tsx index 2f484b4ea7..0d93de4a69 100644 --- a/src/pages/Question/QuestionPage.tsx +++ b/src/pages/Question/QuestionPage.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react' import { Link, useParams } from 'react-router-dom' import { + ContentStatistics, FollowButton, Loader, ModerationStatus, @@ -9,8 +10,8 @@ import { import { logger } from 'src/logger' import { useDiscussionStore } from 'src/stores/Discussions/discussions.store' import { useQuestionStore } from 'src/stores/Question/question.store' -import { isAllowedToEditContent } from 'src/utils/helpers' -import { Box, Button, Card, Flex, Heading, Text } from 'theme-ui' +import { buildStatisticsLabel, isAllowedToEditContent } from 'src/utils/helpers' +import { Box, Button, Card, Divider, Flex, Heading, Text } from 'theme-ui' import { ContentAuthorTimestamp } from '../common/ContentAuthorTimestamp/ContentAuthorTimestamp' import { QuestionComments } from './QuestionComments' @@ -116,47 +117,92 @@ export const QuestionPage = () => { ) : question ? ( <> - - - + + + + + {isEditable && ( + + + + )} + + - - {isEditable && ( - - - - )} - - - + - - {question.title} - - {question.description} - + + {question.title} + + {question.description} + + + + + {question._id && ( { new RegExp(`^${question.description.split(' ')[0]}`), ), ).toBeInTheDocument() + + // Content statistics + expect(wrapper.getByText(`0 views`)).toBeInTheDocument() + expect(wrapper.getByText(`0 following`)).toBeInTheDocument() + expect(wrapper.getByText(`1 comment`)).toBeInTheDocument() + expect(mockFetchQuestionBySlug).toBeCalledWith(question.slug) }) })