Add test data

This commit is contained in:
Henrik HerHde Huettemann 2024-02-29 19:03:18 +01:00
parent ef47a5d292
commit 906495d31b
Signed by: HueHe
GPG key ID: 68FE5FEEBF1EAF5B
4 changed files with 311 additions and 0 deletions

View file

@ -1,6 +1,7 @@
exclude: |
(?x)
.drawio$|
^test/.*.json$|
tsconfig.json$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks

161
test/messages.json Normal file
View file

@ -0,0 +1,161 @@
{
"_id": "msgId001",
"rid": "GENERAL",
"msg": "Hello World!",
"ts": {
"$date": "2000-01-01T12:00:00.000Z"
},
"u": {
"_id": "normalUserId",
"username": "normal_user"
},
"reactions": {
":tada:": {
"usernames": [
"normal_user",
"other_user"
]
},
":heart:": {
"usernames": [
"other_user"
]
},
":warning:": {
"usernames": [
"thirdPerson",
"deleted_user"
]
}
},
"pinned": true,
"pinnedAt": {
"$date": "2001-01-01T12:00:00.000Z"
},
"pinnedBy": {
"_id": "normalUserId",
"username": "normal_user"
}
}
{
"_id": "msgThreadResponse",
"rid": "GENERAL",
"tmid": "msgId001",
"msg": "Hey",
"ts": {
"$date": "2000-01-01T12:03:00.000Z"
},
"u": {
"_id": "otherUserId",
"username": "other_user"
},
"reactions": {
":wave:": {
"usernames": [
"normal_user"
]
}
}
}
{
"_id": "deletedUserMsg",
"rid": "GENERAL",
"msg": "The author doesn't exist",
"ts": {
"$date": "2000-01-02T12:00:00.000Z"
},
"u": {
"_id": "deletedUserId",
"username": "deleted_user"
}
}
{
"_id": "excludedUserMsg",
"rid": "GENERAL",
"msg": "The author is excluded",
"ts": {
"$date": "2000-01-03T12:00:00.000Z"
},
"u": {
"_id": "excludedBot",
"username": "excludedBot"
}
}
{
"_id": "msgInDeletedThread",
"rid": "GENERAL",
"tmid": "deleted",
"msg": "Root message was deleted",
"ts": {
"$date": "2000-01-04T12:00:00.000Z"
},
"u": {
"_id": "normalUserId",
"username": "normal_user"
}
}
{
"_id": "msgInDeletedRoom",
"rid": "deleted",
"msg": "Room was deleted",
"ts": {
"$date": "2000-01-05T12:00:00.000Z"
},
"u": {
"_id": "normalUserId",
"username": "normal_user"
}
}
{
"_id": "userLeft",
"t": "ul",
"rid": "GENERAL",
"msg": "thirdPerson",
"ts": {
"$date": "2000-01-05T12:00:00.000Z"
},
"u": {
"_id": "thirdPerson",
"username": "thirdPerson"
}
}
{
"_id": "msgId002",
"rid": "GENERAL",
"msg": "Second message (more or less)",
"ts": {
"$date": "2000-01-10T12:00:00.000Z"
},
"u": {
"_id": "normalUserId",
"username": "normal_user"
},
"pinned": true,
"pinnedAt": {
"$date": "2000-01-10T14:00:00.000Z"
},
"pinnedBy": {
"_id": "normalUserId",
"username": "normal_user"
}
}
{
"_id": "msgId003",
"rid": "GENERAL",
"msg": "Third, but second pinned",
"ts": {
"$date": "2000-01-10T13:00:00.000Z"
},
"u": {
"_id": "normalUserId",
"username": "normal_user"
},
"pinned": true,
"pinnedAt": {
"$date": "2000-01-10T13:00:00.000Z"
},
"pinnedBy": {
"_id": "normalUserId",
"username": "normal_user"
}
}

57
test/rooms.json Normal file
View file

@ -0,0 +1,57 @@
{
"_id": "GENERAL",
"ts": {
"$date": "2000-01-01T13:37:42.000Z"
},
"t": "c",
"name": "general",
"usernames": [],
"msgs": 99,
"usersCount": 99,
"default": true,
"_updatedAt": {
"$date": "2000-01-01T21:42:00.000Z"
}
}
{
"_id": "publicRoom",
"description": "Public House Room",
"name": "PubRoom",
"t": "c",
"u": {
"_id": "normalUserId"
}
}
{
"_id": "privateRoom",
"description": "Private Room",
"name": "priv",
"t": "p",
"u": {
"_id": "normalUserId"
}
}
{
"_id": "directChat",
"t": "d",
"usernames": [
"normal_user",
"other_user",
"excludedBot"
],
"uids": [
"normalUserId",
"otherUserId",
"excludedBot"
]
}
{
"_id": "selfChat",
"t": "d",
"usernames": [
"normal_user"
],
"uids": [
"normalUserId"
]
}

92
test/users.json Normal file
View file

@ -0,0 +1,92 @@
{
"_id": "rocket.cat",
"createdAt": {
"$date": "2000-01-01T13:37:42.000Z"
},
"avatarOrigin": "local",
"name": "Rocket.Cat",
"username": "rocket.cat",
"status": "online",
"statusDefault": "online",
"utcOffset": 0,
"active": true,
"type": "bot",
"_updatedAt": {
"$date": "2000-01-01T21:42:00.000Z"
},
"roles": [
"bot"
],
"__rooms": [
"GENERAL"
]
}
{
"_id": "normalUserId",
"username": "normal_user",
"type": "user",
"__rooms": [
"GENERAL",
"invalidRoom",
"publicRoom",
"privateRoom",
"directChat",
"directChatDeleted",
"selfChat"
],
"roles": [
"user"
],
"name": "Just a normal user"
}
{
"_id": "userWithoutUsername",
"type": "user",
"__rooms": [
"GENERAL",
"invalidRoom",
"publicRoom"
],
"roles": [
"user"
],
"name": "I need special attention"
}
{
"_id": "excludedBot",
"username": "excludedBot",
"type": "bot",
"__rooms": [
"GENERAL"
],
"roles": [
"user",
"bot"
],
"name": "Excluded Bot"
}
{
"_id": "otherUserId",
"username": "other_user",
"type": "user",
"__rooms": [
"GENERAL",
"publicRoom",
"privateRoom",
"directChat"
],
"roles": [
"user"
],
"name": "Yet another user"
}
{
"_id": "thirdPerson",
"username": "thirdPerson",
"type": "user",
"__rooms": [],
"roles": [
"user"
],
"name": "🥉rd Person"
}