Add basic groupSchema test
This commit is contained in:
parent
c3728dbddd
commit
d747e323c6
2 changed files with 23 additions and 0 deletions
16
app/soapbox/__fixtures__/group-truthsocial.json
Normal file
16
app/soapbox/__fixtures__/group-truthsocial.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"note": "patriots 900000001",
|
||||
"discoverable": true,
|
||||
"id": "109989480368015378",
|
||||
"domain": null,
|
||||
"avatar": "https://media.covfefe.social/groups/avatars/109/989/480/368/015/378/original/50b0d899bc5aae13.jpg",
|
||||
"avatar_static": "https://media.covfefe.social/groups/avatars/109/989/480/368/015/378/original/50b0d899bc5aae13.jpg",
|
||||
"header": "https://media.covfefe.social/groups/headers/109/989/480/368/015/378/original/c5063b59f919cd4a.png",
|
||||
"header_static": "https://media.covfefe.social/groups/headers/109/989/480/368/015/378/original/c5063b59f919cd4a.png",
|
||||
"group_visibility": "everyone",
|
||||
"created_at": "2023-03-08T00:00:00.000Z",
|
||||
"display_name": "PATRIOT PATRIOTS",
|
||||
"membership_required": true,
|
||||
"members_count": 1,
|
||||
"tags": []
|
||||
}
|
7
app/soapbox/schemas/__tests__/group.test.ts
Normal file
7
app/soapbox/schemas/__tests__/group.test.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { groupSchema } from '../group';
|
||||
|
||||
test('groupSchema with a TruthSocial group', () => {
|
||||
const data = require('soapbox/__fixtures__/group-truthsocial.json');
|
||||
const group = groupSchema.parse(data);
|
||||
expect(group.display_name_html).toEqual('PATRIOT PATRIOTS');
|
||||
});
|
Loading…
Reference in a new issue