@@ -107,7 +107,10 @@ const GroupHeader: React.FC
= ({ group }) => {
}
return (
-
+
{isHeaderMissing ? (
) : header}
@@ -120,7 +123,7 @@ const GroupHeader: React.FC
= ({ group }) => {
{renderHeader()}
-
+
= ({ group }) => {
size='xl'
weight='bold'
dangerouslySetInnerHTML={{ __html: group.display_name_html }}
+ data-testid='group-name'
/>
{!isDeleted && (
<>
-
+
@@ -154,7 +158,7 @@ const GroupHeader: React.FC = ({ group }) => {
/>
-
+
diff --git a/app/soapbox/features/group/components/group-member-list-item.tsx b/app/soapbox/features/group/components/group-member-list-item.tsx
index d2226879a..f9b18735d 100644
--- a/app/soapbox/features/group/components/group-member-list-item.tsx
+++ b/app/soapbox/features/group/components/group-member-list-item.tsx
@@ -180,7 +180,11 @@ const GroupMemberListItem = (props: IGroupMemberListItem) => {
}
return (
-
+
@@ -188,6 +192,7 @@ const GroupMemberListItem = (props: IGroupMemberListItem) => {
{(isMemberOwner || isMemberAdmin) ? (
{
require('@tabler/icons/pin.svg')
}
iconClassName='h-5 w-5 text-primary-500 dark:text-accent-blue'
+ data-testid='pin-icon'
/>
);
@@ -123,13 +124,18 @@ const GroupTagListItem = (props: IGroupMemberListItem) => {
};
return (
-
+
#{tag.name}
diff --git a/app/soapbox/jest/factory.ts b/app/soapbox/jest/factory.ts
index 07f4bc7d2..35ea063e0 100644
--- a/app/soapbox/jest/factory.ts
+++ b/app/soapbox/jest/factory.ts
@@ -1,23 +1,34 @@
import { v4 as uuidv4 } from 'uuid';
import {
+ accountSchema,
adSchema,
cardSchema,
- groupSchema,
+ groupMemberSchema,
groupRelationshipSchema,
+ groupSchema,
groupTagSchema,
relationshipSchema,
+ type Account,
type Ad,
type Card,
type Group,
+ type GroupMember,
type GroupRelationship,
type GroupTag,
type Relationship,
} from 'soapbox/schemas';
+import { GroupRoles } from 'soapbox/schemas/group-member';
// TODO: there's probably a better way to create these factory functions.
// This looks promising but didn't work on my first attempt: https://github.com/anatine/zod-plugins/tree/main/packages/zod-mock
+function buildAccount(props: Partial = {}): Account {
+ return accountSchema.parse(Object.assign({
+ id: uuidv4(),
+ }, props));
+}
+
function buildCard(props: Partial = {}): Card {
return cardSchema.parse(Object.assign({
url: 'https://soapbox.test',
@@ -39,6 +50,18 @@ function buildGroupRelationship(props: Partial = {}): GroupRe
function buildGroupTag(props: Partial = {}): GroupTag {
return groupTagSchema.parse(Object.assign({
id: uuidv4(),
+ name: uuidv4(),
+ }, props));
+}
+
+function buildGroupMember(
+ props: Partial = {},
+ accountProps: Partial = {},
+): GroupMember {
+ return groupMemberSchema.parse(Object.assign({
+ id: uuidv4(),
+ account: buildAccount(accountProps),
+ role: GroupRoles.USER,
}, props));
}
@@ -55,10 +78,11 @@ function buildRelationship(props: Partial = {}): Relationship {
}
export {
+ buildAd,
buildCard,
buildGroup,
+ buildGroupMember,
buildGroupRelationship,
buildGroupTag,
- buildAd,
buildRelationship,
};
\ No newline at end of file