initial commits
parent
4c6ffad640
commit
ebc24716de
|
@ -35,26 +35,27 @@ func TestReport_MarshalJSON(t *testing.T) {
|
||||||
ID: opt.Something("12345"),
|
ID: opt.Something("12345"),
|
||||||
UserName: opt.Something("joeblow"),
|
UserName: opt.Something("joeblow"),
|
||||||
Acct: opt.Something("joeblow@example.com"),
|
Acct: opt.Something("joeblow@example.com"),
|
||||||
DisplayName: opt.Something("Joe Blow :-)"),
|
|
||||||
Locked: opt.Something(false),
|
|
||||||
Bot: opt.Something(false),
|
|
||||||
Discoverable: opt.Something(true),
|
|
||||||
CreatedAt: opt.Something("2017-02-08T02:00:53.274Z"),
|
|
||||||
Note: opt.Something("<p>I came. I saw. I conquered!</p>"),
|
|
||||||
URL: opt.Something("https://example.com/@joeblow"),
|
URL: opt.Something("https://example.com/@joeblow"),
|
||||||
URI: opt.Something("https://example.com/users/joeblow"),
|
URI: opt.Something("https://example.com/users/joeblow"),
|
||||||
|
DisplayName: opt.Something("Joe Blow :-)"),
|
||||||
|
Note: opt.Something("<p>I came. I saw. I conquered!</p>"),
|
||||||
Avatar: opt.Something("https://files.example.com/avatar/joeblow.png"),
|
Avatar: opt.Something("https://files.example.com/avatar/joeblow.png"),
|
||||||
AvatarStatic: opt.Something("https://files.example.com/avatar-static/joeblow.png"),
|
AvatarStatic: opt.Something("https://files.example.com/avatar-static/joeblow.png"),
|
||||||
Header: opt.Something("https://files.example.com/header/joeblow.png"),
|
Header: opt.Something("https://files.example.com/header/joeblow.png"),
|
||||||
HeaderStatic: opt.Something("https://files.example.com/header-static/joeblow/png"),
|
HeaderStatic: opt.Something("https://files.example.com/header-static/joeblow/png"),
|
||||||
|
//Fields []Field `json:"fields"`
|
||||||
|
//Emojis []CustomEmoji `json:"emojis"`
|
||||||
|
Locked: opt.Something(false),
|
||||||
|
Bot: opt.Something(false),
|
||||||
|
Group: opt.Something(false),
|
||||||
|
Discoverable: nul.Something(true),
|
||||||
|
CreatedAt: opt.Something("2017-02-08T02:00:53.274Z"),
|
||||||
|
LastStatusAt: nul.Something("2023-09-27T00:31:59Z"),
|
||||||
|
StatusesCount: opt.Something(jsonint.Int64(9876543210)),
|
||||||
FollowersCount: opt.Something(jsonint.Int64(12345)),
|
FollowersCount: opt.Something(jsonint.Int64(12345)),
|
||||||
FollowingCount: opt.Something(jsonint.Int64(210)),
|
FollowingCount: opt.Something(jsonint.Int64(210)),
|
||||||
StatusesCount: opt.Something(jsonint.Int64(9876543210)),
|
NoIndex: nul.Nothing[bool](),
|
||||||
LastStatusAt: opt.Something("2023-09-27T00:31:59Z"),
|
|
||||||
NoIndex: opt.Something(false),
|
|
||||||
//Emojis []CustomEmoji `json:"emojis"`
|
|
||||||
//Roles []Role `json:"roles"`
|
//Roles []Role `json:"roles"`
|
||||||
//Fields []Field `json:"fields"`
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Expected :
|
Expected :
|
||||||
|
@ -84,22 +85,14 @@ func TestReport_MarshalJSON(t *testing.T) {
|
||||||
`,`+
|
`,`+
|
||||||
`"acct":"joeblow@example.com"`+
|
`"acct":"joeblow@example.com"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"display_name":"Joe Blow :-)"`+
|
|
||||||
`,`+
|
|
||||||
`"locked":false`+
|
|
||||||
`,`+
|
|
||||||
`"bot":false`+
|
|
||||||
`,`+
|
|
||||||
`"discoverable":true`+
|
|
||||||
`,`+
|
|
||||||
`"created_at":"2017-02-08T02:00:53.274Z"`+
|
|
||||||
`,`+
|
|
||||||
`"note":"\u003cp\u003eI came. I saw. I conquered!\u003c/p\u003e"`+
|
|
||||||
`,`+
|
|
||||||
`"url":"https://example.com/@joeblow"`+
|
`"url":"https://example.com/@joeblow"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"uri":"https://example.com/users/joeblow"`+
|
`"uri":"https://example.com/users/joeblow"`+
|
||||||
`,`+
|
`,`+
|
||||||
|
`"display_name":"Joe Blow :-)"`+
|
||||||
|
`,`+
|
||||||
|
`"note":"\u003cp\u003eI came. I saw. I conquered!\u003c/p\u003e"`+
|
||||||
|
`,`+
|
||||||
`"avatar":"https://files.example.com/avatar/joeblow.png"`+
|
`"avatar":"https://files.example.com/avatar/joeblow.png"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"avatar_static":"https://files.example.com/avatar-static/joeblow.png"`+
|
`"avatar_static":"https://files.example.com/avatar-static/joeblow.png"`+
|
||||||
|
@ -108,32 +101,44 @@ func TestReport_MarshalJSON(t *testing.T) {
|
||||||
`,`+
|
`,`+
|
||||||
`"header_static":"https://files.example.com/header-static/joeblow/png"`+
|
`"header_static":"https://files.example.com/header-static/joeblow/png"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"followers_count":12345`+
|
`"fields":[]`+
|
||||||
`,`+
|
`,`+
|
||||||
`"following_count":210`+
|
`"emojis":[]`+
|
||||||
`,`+
|
`,`+
|
||||||
`"statuses_count":9876543210`+
|
`"locked":false`+
|
||||||
|
`,`+
|
||||||
|
`"bot":false`+
|
||||||
|
`,`+
|
||||||
|
`"group":false`+
|
||||||
|
`,`+
|
||||||
|
`"discoverable":true`+
|
||||||
|
`,`+
|
||||||
|
`"created_at":"2017-02-08T02:00:53.274Z"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"last_status_at":"2023-09-27T00:31:59Z"`+
|
`"last_status_at":"2023-09-27T00:31:59Z"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"noindex":false`+
|
`"statuses_count":9876543210`+
|
||||||
`,`+
|
`,`+
|
||||||
`"emojis":null`+
|
`"followers_count":12345`+
|
||||||
`,`+
|
`,`+
|
||||||
`"roles":null`+
|
`"following_count":210`+
|
||||||
`,`+
|
|
||||||
`"fields":null`+
|
|
||||||
`}`+
|
`}`+
|
||||||
`}`,
|
`}`,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Report: ent.Report{
|
Report: ent.Report{
|
||||||
ID: opt.Something("0918273645"),
|
ID: opt.Something("0918273645"),
|
||||||
ActionTaken: opt.Something(true),
|
ActionTaken: opt.Something(true),
|
||||||
ActionTakenAt: nul.Something("2024-02-27T00:31:59Z"),
|
ActionTakenAt: nul.Null[string](),
|
||||||
Category: opt.Something("spam"),
|
Category: opt.Something("spam"),
|
||||||
Comment: opt.Something("this f-er spamed me"),
|
Comment: opt.Something("this f-er spamed me"),
|
||||||
Forwarded: opt.Something(false),
|
Forwarded: opt.Something(false),
|
||||||
|
@ -144,26 +149,27 @@ func TestReport_MarshalJSON(t *testing.T) {
|
||||||
ID: opt.Something("12345"),
|
ID: opt.Something("12345"),
|
||||||
UserName: opt.Something("joeblow"),
|
UserName: opt.Something("joeblow"),
|
||||||
Acct: opt.Something("joeblow@example.com"),
|
Acct: opt.Something("joeblow@example.com"),
|
||||||
DisplayName: opt.Something("Joe Blow :-)"),
|
|
||||||
Locked: opt.Something(false),
|
|
||||||
Bot: opt.Something(false),
|
|
||||||
Discoverable: opt.Something(true),
|
|
||||||
CreatedAt: opt.Something("2017-02-08T02:00:53.274Z"),
|
|
||||||
Note: opt.Something("<p>I came. I saw. I conquered!</p>"),
|
|
||||||
URL: opt.Something("https://example.com/@joeblow"),
|
URL: opt.Something("https://example.com/@joeblow"),
|
||||||
URI: opt.Something("https://example.com/users/joeblow"),
|
URI: opt.Something("https://example.com/users/joeblow"),
|
||||||
|
DisplayName: opt.Something("Joe Blow :-)"),
|
||||||
|
Note: opt.Something("<p>I came. I saw. I conquered!</p>"),
|
||||||
Avatar: opt.Something("https://files.example.com/avatar/joeblow.png"),
|
Avatar: opt.Something("https://files.example.com/avatar/joeblow.png"),
|
||||||
AvatarStatic: opt.Something("https://files.example.com/avatar-static/joeblow.png"),
|
AvatarStatic: opt.Something("https://files.example.com/avatar-static/joeblow.png"),
|
||||||
Header: opt.Something("https://files.example.com/header/joeblow.png"),
|
Header: opt.Something("https://files.example.com/header/joeblow.png"),
|
||||||
HeaderStatic: opt.Something("https://files.example.com/header-static/joeblow/png"),
|
HeaderStatic: opt.Something("https://files.example.com/header-static/joeblow/png"),
|
||||||
|
//Fields []Field `json:"fields"`
|
||||||
|
//Emojis []CustomEmoji `json:"emojis"`
|
||||||
|
Locked: opt.Something(false),
|
||||||
|
Bot: opt.Something(false),
|
||||||
|
Group: opt.Something(false),
|
||||||
|
Discoverable: nul.Something(true),
|
||||||
|
CreatedAt: opt.Something("2017-02-08T02:00:53.274Z"),
|
||||||
|
LastStatusAt: nul.Something("2023-09-27T00:31:59Z"),
|
||||||
|
StatusesCount: opt.Something(jsonint.Int64(9876543210)),
|
||||||
FollowersCount: opt.Something(jsonint.Int64(12345)),
|
FollowersCount: opt.Something(jsonint.Int64(12345)),
|
||||||
FollowingCount: opt.Something(jsonint.Int64(210)),
|
FollowingCount: opt.Something(jsonint.Int64(210)),
|
||||||
StatusesCount: opt.Something(jsonint.Int64(9876543210)),
|
NoIndex: nul.Nothing[bool](),
|
||||||
LastStatusAt: opt.Something("2023-09-27T00:31:59Z"),
|
|
||||||
NoIndex: opt.Something(false),
|
|
||||||
//Emojis []CustomEmoji `json:"emojis"`
|
|
||||||
//Roles []Role `json:"roles"`
|
//Roles []Role `json:"roles"`
|
||||||
//Fields []Field `json:"fields"`
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Expected :
|
Expected :
|
||||||
|
@ -172,7 +178,7 @@ func TestReport_MarshalJSON(t *testing.T) {
|
||||||
`,`+
|
`,`+
|
||||||
`"action_taken":true`+
|
`"action_taken":true`+
|
||||||
`,`+
|
`,`+
|
||||||
`"action_taken_at":"2024-02-27T00:31:59Z"`+
|
`"action_taken_at":null`+
|
||||||
`,`+
|
`,`+
|
||||||
`"category":"spam"`+
|
`"category":"spam"`+
|
||||||
`,`+
|
`,`+
|
||||||
|
@ -193,22 +199,14 @@ func TestReport_MarshalJSON(t *testing.T) {
|
||||||
`,`+
|
`,`+
|
||||||
`"acct":"joeblow@example.com"`+
|
`"acct":"joeblow@example.com"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"display_name":"Joe Blow :-)"`+
|
|
||||||
`,`+
|
|
||||||
`"locked":false`+
|
|
||||||
`,`+
|
|
||||||
`"bot":false`+
|
|
||||||
`,`+
|
|
||||||
`"discoverable":true`+
|
|
||||||
`,`+
|
|
||||||
`"created_at":"2017-02-08T02:00:53.274Z"`+
|
|
||||||
`,`+
|
|
||||||
`"note":"\u003cp\u003eI came. I saw. I conquered!\u003c/p\u003e"`+
|
|
||||||
`,`+
|
|
||||||
`"url":"https://example.com/@joeblow"`+
|
`"url":"https://example.com/@joeblow"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"uri":"https://example.com/users/joeblow"`+
|
`"uri":"https://example.com/users/joeblow"`+
|
||||||
`,`+
|
`,`+
|
||||||
|
`"display_name":"Joe Blow :-)"`+
|
||||||
|
`,`+
|
||||||
|
`"note":"\u003cp\u003eI came. I saw. I conquered!\u003c/p\u003e"`+
|
||||||
|
`,`+
|
||||||
`"avatar":"https://files.example.com/avatar/joeblow.png"`+
|
`"avatar":"https://files.example.com/avatar/joeblow.png"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"avatar_static":"https://files.example.com/avatar-static/joeblow.png"`+
|
`"avatar_static":"https://files.example.com/avatar-static/joeblow.png"`+
|
||||||
|
@ -217,71 +215,84 @@ func TestReport_MarshalJSON(t *testing.T) {
|
||||||
`,`+
|
`,`+
|
||||||
`"header_static":"https://files.example.com/header-static/joeblow/png"`+
|
`"header_static":"https://files.example.com/header-static/joeblow/png"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"followers_count":12345`+
|
`"fields":[]`+
|
||||||
`,`+
|
`,`+
|
||||||
`"following_count":210`+
|
`"emojis":[]`+
|
||||||
`,`+
|
`,`+
|
||||||
`"statuses_count":9876543210`+
|
`"locked":false`+
|
||||||
|
`,`+
|
||||||
|
`"bot":false`+
|
||||||
|
`,`+
|
||||||
|
`"group":false`+
|
||||||
|
`,`+
|
||||||
|
`"discoverable":true`+
|
||||||
|
`,`+
|
||||||
|
`"created_at":"2017-02-08T02:00:53.274Z"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"last_status_at":"2023-09-27T00:31:59Z"`+
|
`"last_status_at":"2023-09-27T00:31:59Z"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"noindex":false`+
|
`"statuses_count":9876543210`+
|
||||||
`,`+
|
`,`+
|
||||||
`"emojis":null`+
|
`"followers_count":12345`+
|
||||||
`,`+
|
`,`+
|
||||||
`"roles":null`+
|
`"following_count":210`+
|
||||||
`,`+
|
|
||||||
`"fields":null`+
|
|
||||||
`}`+
|
`}`+
|
||||||
`}`,
|
`}`,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Report: ent.Report{
|
Report: ent.Report{
|
||||||
ID: opt.Something("0918273645"),
|
ID: opt.Something("0918273645"),
|
||||||
ActionTaken: opt.Something(true),
|
ActionTaken: opt.Something(false),
|
||||||
ActionTakenAt: nul.Something("2024-02-27T00:31:59Z"),
|
ActionTakenAt: nul.Something("2023-09-28T07:10:19Z"),
|
||||||
Category: opt.Something("spam"),
|
Category: opt.Something("spam"),
|
||||||
Comment: opt.Something("this f-er spamed me"),
|
Comment: opt.Something("this f-er spamed me"),
|
||||||
Forwarded: opt.Something(false),
|
Forwarded: opt.Something(false),
|
||||||
CreatedAt: opt.Something("2023-09-27T00:31:59Z"),
|
CreatedAt: opt.Something("2023-09-27T00:31:59Z"),
|
||||||
StatusIDs: nul.Something(jsonstr.CompileStrings("7823598731", "7916234158", "5218091242")),
|
StatusIDs: nul.Null[jsonstr.Strings](),
|
||||||
RuleIDs: nul.Null[jsonstr.Strings](),
|
RuleIDs: nul.Null[jsonstr.Strings](),
|
||||||
TargetAccount: ent.Account{
|
TargetAccount: ent.Account{
|
||||||
ID: opt.Something("12345"),
|
ID: opt.Something("12345"),
|
||||||
UserName: opt.Something("joeblow"),
|
UserName: opt.Something("joeblow"),
|
||||||
Acct: opt.Something("joeblow@example.com"),
|
Acct: opt.Something("joeblow@example.com"),
|
||||||
DisplayName: opt.Something("Joe Blow :-)"),
|
|
||||||
Locked: opt.Something(false),
|
|
||||||
Bot: opt.Something(false),
|
|
||||||
Discoverable: opt.Something(true),
|
|
||||||
CreatedAt: opt.Something("2017-02-08T02:00:53.274Z"),
|
|
||||||
Note: opt.Something("<p>I came. I saw. I conquered!</p>"),
|
|
||||||
URL: opt.Something("https://example.com/@joeblow"),
|
URL: opt.Something("https://example.com/@joeblow"),
|
||||||
URI: opt.Something("https://example.com/users/joeblow"),
|
URI: opt.Something("https://example.com/users/joeblow"),
|
||||||
|
DisplayName: opt.Something("Joe Blow :-)"),
|
||||||
|
Note: opt.Something("<p>I came. I saw. I conquered!</p>"),
|
||||||
Avatar: opt.Something("https://files.example.com/avatar/joeblow.png"),
|
Avatar: opt.Something("https://files.example.com/avatar/joeblow.png"),
|
||||||
AvatarStatic: opt.Something("https://files.example.com/avatar-static/joeblow.png"),
|
AvatarStatic: opt.Something("https://files.example.com/avatar-static/joeblow.png"),
|
||||||
Header: opt.Something("https://files.example.com/header/joeblow.png"),
|
Header: opt.Something("https://files.example.com/header/joeblow.png"),
|
||||||
HeaderStatic: opt.Something("https://files.example.com/header-static/joeblow/png"),
|
HeaderStatic: opt.Something("https://files.example.com/header-static/joeblow/png"),
|
||||||
|
//Fields []Field `json:"fields"`
|
||||||
|
//Emojis []CustomEmoji `json:"emojis"`
|
||||||
|
Locked: opt.Something(false),
|
||||||
|
Bot: opt.Something(false),
|
||||||
|
Group: opt.Something(false),
|
||||||
|
Discoverable: nul.Something(true),
|
||||||
|
CreatedAt: opt.Something("2017-02-08T02:00:53.274Z"),
|
||||||
|
LastStatusAt: nul.Something("2023-09-27T00:31:59Z"),
|
||||||
|
StatusesCount: opt.Something(jsonint.Int64(9876543210)),
|
||||||
FollowersCount: opt.Something(jsonint.Int64(12345)),
|
FollowersCount: opt.Something(jsonint.Int64(12345)),
|
||||||
FollowingCount: opt.Something(jsonint.Int64(210)),
|
FollowingCount: opt.Something(jsonint.Int64(210)),
|
||||||
StatusesCount: opt.Something(jsonint.Int64(9876543210)),
|
NoIndex: nul.Nothing[bool](),
|
||||||
LastStatusAt: opt.Something("2023-09-27T00:31:59Z"),
|
|
||||||
NoIndex: opt.Something(false),
|
|
||||||
//Emojis []CustomEmoji `json:"emojis"`
|
|
||||||
//Roles []Role `json:"roles"`
|
//Roles []Role `json:"roles"`
|
||||||
//Fields []Field `json:"fields"`
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Expected :
|
Expected :
|
||||||
`{`+
|
`{`+
|
||||||
`"id":"0918273645"`+
|
`"id":"0918273645"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"action_taken":true`+
|
`"action_taken":false`+
|
||||||
`,`+
|
`,`+
|
||||||
`"action_taken_at":"2024-02-27T00:31:59Z"`+
|
`"action_taken_at":"2023-09-28T07:10:19Z"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"category":"spam"`+
|
`"category":"spam"`+
|
||||||
`,`+
|
`,`+
|
||||||
|
@ -291,7 +302,7 @@ func TestReport_MarshalJSON(t *testing.T) {
|
||||||
`,`+
|
`,`+
|
||||||
`"created_at":"2023-09-27T00:31:59Z"`+
|
`"created_at":"2023-09-27T00:31:59Z"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"status_ids":["7823598731","7916234158","5218091242"]`+
|
`"status_ids":null`+
|
||||||
`,`+
|
`,`+
|
||||||
`"rule_ids":null`+
|
`"rule_ids":null`+
|
||||||
`,`+
|
`,`+
|
||||||
|
@ -302,131 +313,14 @@ func TestReport_MarshalJSON(t *testing.T) {
|
||||||
`,`+
|
`,`+
|
||||||
`"acct":"joeblow@example.com"`+
|
`"acct":"joeblow@example.com"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"display_name":"Joe Blow :-)"`+
|
|
||||||
`,`+
|
|
||||||
`"locked":false`+
|
|
||||||
`,`+
|
|
||||||
`"bot":false`+
|
|
||||||
`,`+
|
|
||||||
`"discoverable":true`+
|
|
||||||
`,`+
|
|
||||||
`"created_at":"2017-02-08T02:00:53.274Z"`+
|
|
||||||
`,`+
|
|
||||||
`"note":"\u003cp\u003eI came. I saw. I conquered!\u003c/p\u003e"`+
|
|
||||||
`,`+
|
|
||||||
`"url":"https://example.com/@joeblow"`+
|
`"url":"https://example.com/@joeblow"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"uri":"https://example.com/users/joeblow"`+
|
`"uri":"https://example.com/users/joeblow"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"avatar":"https://files.example.com/avatar/joeblow.png"`+
|
|
||||||
`,`+
|
|
||||||
`"avatar_static":"https://files.example.com/avatar-static/joeblow.png"`+
|
|
||||||
`,`+
|
|
||||||
`"header":"https://files.example.com/header/joeblow.png"`+
|
|
||||||
`,`+
|
|
||||||
`"header_static":"https://files.example.com/header-static/joeblow/png"`+
|
|
||||||
`,`+
|
|
||||||
`"followers_count":12345`+
|
|
||||||
`,`+
|
|
||||||
`"following_count":210`+
|
|
||||||
`,`+
|
|
||||||
`"statuses_count":9876543210`+
|
|
||||||
`,`+
|
|
||||||
`"last_status_at":"2023-09-27T00:31:59Z"`+
|
|
||||||
`,`+
|
|
||||||
`"noindex":false`+
|
|
||||||
`,`+
|
|
||||||
`"emojis":null`+
|
|
||||||
`,`+
|
|
||||||
`"roles":null`+
|
|
||||||
`,`+
|
|
||||||
`"fields":null`+
|
|
||||||
`}`+
|
|
||||||
`}`,
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
Report: ent.Report{
|
|
||||||
ID: opt.Something("0918273645"),
|
|
||||||
ActionTaken: opt.Something(true),
|
|
||||||
ActionTakenAt: nul.Something("2024-02-27T00:31:59Z"),
|
|
||||||
Category: opt.Something("spam"),
|
|
||||||
Comment: opt.Something("this f-er spamed me"),
|
|
||||||
Forwarded: opt.Something(false),
|
|
||||||
CreatedAt: opt.Something("2023-09-27T00:31:59Z"),
|
|
||||||
StatusIDs: nul.Something(jsonstr.CompileStrings("7823598731", "7916234158", "5218091242")),
|
|
||||||
RuleIDs: nul.Something(jsonstr.CompileStrings("23","1","13","42")),
|
|
||||||
TargetAccount: ent.Account{
|
|
||||||
ID: opt.Something("12345"),
|
|
||||||
UserName: opt.Something("joeblow"),
|
|
||||||
Acct: opt.Something("joeblow@example.com"),
|
|
||||||
DisplayName: opt.Something("Joe Blow :-)"),
|
|
||||||
Locked: opt.Something(false),
|
|
||||||
Bot: opt.Something(false),
|
|
||||||
Discoverable: opt.Something(true),
|
|
||||||
CreatedAt: opt.Something("2017-02-08T02:00:53.274Z"),
|
|
||||||
Note: opt.Something("<p>I came. I saw. I conquered!</p>"),
|
|
||||||
URL: opt.Something("https://example.com/@joeblow"),
|
|
||||||
URI: opt.Something("https://example.com/users/joeblow"),
|
|
||||||
Avatar: opt.Something("https://files.example.com/avatar/joeblow.png"),
|
|
||||||
AvatarStatic: opt.Something("https://files.example.com/avatar-static/joeblow.png"),
|
|
||||||
Header: opt.Something("https://files.example.com/header/joeblow.png"),
|
|
||||||
HeaderStatic: opt.Something("https://files.example.com/header-static/joeblow/png"),
|
|
||||||
FollowersCount: opt.Something(jsonint.Int64(12345)),
|
|
||||||
FollowingCount: opt.Something(jsonint.Int64(210)),
|
|
||||||
StatusesCount: opt.Something(jsonint.Int64(9876543210)),
|
|
||||||
LastStatusAt: opt.Something("2023-09-27T00:31:59Z"),
|
|
||||||
NoIndex: opt.Something(false),
|
|
||||||
//Emojis []CustomEmoji `json:"emojis"`
|
|
||||||
//Roles []Role `json:"roles"`
|
|
||||||
//Fields []Field `json:"fields"`
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Expected :
|
|
||||||
`{`+
|
|
||||||
`"id":"0918273645"`+
|
|
||||||
`,`+
|
|
||||||
`"action_taken":true`+
|
|
||||||
`,`+
|
|
||||||
`"action_taken_at":"2024-02-27T00:31:59Z"`+
|
|
||||||
`,`+
|
|
||||||
`"category":"spam"`+
|
|
||||||
`,`+
|
|
||||||
`"comment":"this f-er spamed me"`+
|
|
||||||
`,`+
|
|
||||||
`"forwarded":false`+
|
|
||||||
`,`+
|
|
||||||
`"created_at":"2023-09-27T00:31:59Z"`+
|
|
||||||
`,`+
|
|
||||||
`"status_ids":["7823598731","7916234158","5218091242"]`+
|
|
||||||
`,`+
|
|
||||||
`"rule_ids":["23","1","13","42"]`+
|
|
||||||
`,`+
|
|
||||||
`"target_account":{`+
|
|
||||||
`"id":"12345"`+
|
|
||||||
`,`+
|
|
||||||
`"username":"joeblow"`+
|
|
||||||
`,`+
|
|
||||||
`"acct":"joeblow@example.com"`+
|
|
||||||
`,`+
|
|
||||||
`"display_name":"Joe Blow :-)"`+
|
`"display_name":"Joe Blow :-)"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"locked":false`+
|
|
||||||
`,`+
|
|
||||||
`"bot":false`+
|
|
||||||
`,`+
|
|
||||||
`"discoverable":true`+
|
|
||||||
`,`+
|
|
||||||
`"created_at":"2017-02-08T02:00:53.274Z"`+
|
|
||||||
`,`+
|
|
||||||
`"note":"\u003cp\u003eI came. I saw. I conquered!\u003c/p\u003e"`+
|
`"note":"\u003cp\u003eI came. I saw. I conquered!\u003c/p\u003e"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"url":"https://example.com/@joeblow"`+
|
|
||||||
`,`+
|
|
||||||
`"uri":"https://example.com/users/joeblow"`+
|
|
||||||
`,`+
|
|
||||||
`"avatar":"https://files.example.com/avatar/joeblow.png"`+
|
`"avatar":"https://files.example.com/avatar/joeblow.png"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"avatar_static":"https://files.example.com/avatar-static/joeblow.png"`+
|
`"avatar_static":"https://files.example.com/avatar-static/joeblow.png"`+
|
||||||
|
@ -435,368 +329,27 @@ func TestReport_MarshalJSON(t *testing.T) {
|
||||||
`,`+
|
`,`+
|
||||||
`"header_static":"https://files.example.com/header-static/joeblow/png"`+
|
`"header_static":"https://files.example.com/header-static/joeblow/png"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"followers_count":12345`+
|
`"fields":[]`+
|
||||||
`,`+
|
`,`+
|
||||||
`"following_count":210`+
|
`"emojis":[]`+
|
||||||
`,`+
|
|
||||||
`"statuses_count":9876543210`+
|
|
||||||
`,`+
|
|
||||||
`"last_status_at":"2023-09-27T00:31:59Z"`+
|
|
||||||
`,`+
|
|
||||||
`"noindex":false`+
|
|
||||||
`,`+
|
|
||||||
`"emojis":null`+
|
|
||||||
`,`+
|
|
||||||
`"roles":null`+
|
|
||||||
`,`+
|
|
||||||
`"fields":null`+
|
|
||||||
`}`+
|
|
||||||
`}`,
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
Report: ent.Report{
|
|
||||||
ID: opt.Something("0918273645"),
|
|
||||||
ActionTaken: opt.Something(true),
|
|
||||||
ActionTakenAt: nul.Something("2024-02-27T00:31:59Z"),
|
|
||||||
Category: opt.Something("spam"),
|
|
||||||
Comment: opt.Something("this f-er spamed me"),
|
|
||||||
Forwarded: opt.Something(false),
|
|
||||||
CreatedAt: opt.Something("2023-09-27T00:31:59Z"),
|
|
||||||
StatusIDs: nul.Something(jsonstr.CompileStrings("7823598731", "7916234158", "5218091242")),
|
|
||||||
RuleIDs: nul.Something(jsonstr.CompileStrings("23","1","13","42")),
|
|
||||||
TargetAccount: ent.Account{
|
|
||||||
ID: opt.Something("12345"),
|
|
||||||
UserName: opt.Something("joeblow"),
|
|
||||||
Acct: opt.Something("joeblow@example.com"),
|
|
||||||
DisplayName: opt.Something("Joe Blow :-) :batman:"),
|
|
||||||
Locked: opt.Something(false),
|
|
||||||
Bot: opt.Something(false),
|
|
||||||
Discoverable: opt.Something(true),
|
|
||||||
CreatedAt: opt.Something("2017-02-08T02:00:53.274Z"),
|
|
||||||
Note: opt.Something("<p>I came. I saw. I conquered!</p>"),
|
|
||||||
URL: opt.Something("https://example.com/@joeblow"),
|
|
||||||
URI: opt.Something("https://example.com/users/joeblow"),
|
|
||||||
Avatar: opt.Something("https://files.example.com/avatar/joeblow.png"),
|
|
||||||
AvatarStatic: opt.Something("https://files.example.com/avatar-static/joeblow.png"),
|
|
||||||
Header: opt.Something("https://files.example.com/header/joeblow.png"),
|
|
||||||
HeaderStatic: opt.Something("https://files.example.com/header-static/joeblow/png"),
|
|
||||||
FollowersCount: opt.Something(jsonint.Int64(12345)),
|
|
||||||
FollowingCount: opt.Something(jsonint.Int64(210)),
|
|
||||||
StatusesCount: opt.Something(jsonint.Int64(9876543210)),
|
|
||||||
LastStatusAt: opt.Something("2023-09-27T00:31:59Z"),
|
|
||||||
NoIndex: opt.Something(true),
|
|
||||||
Emojis: []ent.CustomEmoji{
|
|
||||||
ent.CustomEmoji{
|
|
||||||
ShortCode: opt.Something("batman"),
|
|
||||||
URL: opt.Something("https://files.example.com/emoji/batman.png"),
|
|
||||||
StaticURL: opt.Something("https://files.example.com/emoji-static/batman.png"),
|
|
||||||
VisibleInPicker: opt.Something(true),
|
|
||||||
},
|
|
||||||
ent.CustomEmoji{
|
|
||||||
ShortCode: opt.Something("spiderman"),
|
|
||||||
URL: opt.Something("https://files.example.com/emoji/spiderman.png"),
|
|
||||||
StaticURL: opt.Something("https://files.example.com/emoji-static/spiderman.png"),
|
|
||||||
VisibleInPicker: opt.Something(true),
|
|
||||||
Category: opt.Something("spiders"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
//Roles []Role `json:"roles"`
|
|
||||||
//Fields []Field `json:"fields"`
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Expected :
|
|
||||||
`{`+
|
|
||||||
`"id":"0918273645"`+
|
|
||||||
`,`+
|
|
||||||
`"action_taken":true`+
|
|
||||||
`,`+
|
|
||||||
`"action_taken_at":"2024-02-27T00:31:59Z"`+
|
|
||||||
`,`+
|
|
||||||
`"category":"spam"`+
|
|
||||||
`,`+
|
|
||||||
`"comment":"this f-er spamed me"`+
|
|
||||||
`,`+
|
|
||||||
`"forwarded":false`+
|
|
||||||
`,`+
|
|
||||||
`"created_at":"2023-09-27T00:31:59Z"`+
|
|
||||||
`,`+
|
|
||||||
`"status_ids":["7823598731","7916234158","5218091242"]`+
|
|
||||||
`,`+
|
|
||||||
`"rule_ids":["23","1","13","42"]`+
|
|
||||||
`,`+
|
|
||||||
`"target_account":{`+
|
|
||||||
`"id":"12345"`+
|
|
||||||
`,`+
|
|
||||||
`"username":"joeblow"`+
|
|
||||||
`,`+
|
|
||||||
`"acct":"joeblow@example.com"`+
|
|
||||||
`,`+
|
|
||||||
`"display_name":"Joe Blow :-) :batman:"`+
|
|
||||||
`,`+
|
`,`+
|
||||||
`"locked":false`+
|
`"locked":false`+
|
||||||
`,`+
|
`,`+
|
||||||
`"bot":false`+
|
`"bot":false`+
|
||||||
`,`+
|
`,`+
|
||||||
`"discoverable":true`+
|
`"group":false`+
|
||||||
`,`+
|
|
||||||
`"created_at":"2017-02-08T02:00:53.274Z"`+
|
|
||||||
`,`+
|
|
||||||
`"note":"\u003cp\u003eI came. I saw. I conquered!\u003c/p\u003e"`+
|
|
||||||
`,`+
|
|
||||||
`"url":"https://example.com/@joeblow"`+
|
|
||||||
`,`+
|
|
||||||
`"uri":"https://example.com/users/joeblow"`+
|
|
||||||
`,`+
|
|
||||||
`"avatar":"https://files.example.com/avatar/joeblow.png"`+
|
|
||||||
`,`+
|
|
||||||
`"avatar_static":"https://files.example.com/avatar-static/joeblow.png"`+
|
|
||||||
`,`+
|
|
||||||
`"header":"https://files.example.com/header/joeblow.png"`+
|
|
||||||
`,`+
|
|
||||||
`"header_static":"https://files.example.com/header-static/joeblow/png"`+
|
|
||||||
`,`+
|
|
||||||
`"followers_count":12345`+
|
|
||||||
`,`+
|
|
||||||
`"following_count":210`+
|
|
||||||
`,`+
|
|
||||||
`"statuses_count":9876543210`+
|
|
||||||
`,`+
|
|
||||||
`"last_status_at":"2023-09-27T00:31:59Z"`+
|
|
||||||
`,`+
|
|
||||||
`"noindex":true`+
|
|
||||||
`,`+
|
|
||||||
`"emojis":[`+
|
|
||||||
`{`+
|
|
||||||
`"shortcode":"batman"`+
|
|
||||||
`,`+
|
|
||||||
`"static_url":"https://files.example.com/emoji-static/batman.png"`+
|
|
||||||
`,`+
|
|
||||||
`"url":"https://files.example.com/emoji/batman.png"`+
|
|
||||||
`,`+
|
|
||||||
`"visible_in_picker":true`+
|
|
||||||
`}`+
|
|
||||||
`,`+
|
|
||||||
`{`+
|
|
||||||
`"category":"spiders"`+
|
|
||||||
`,`+
|
|
||||||
`"shortcode":"spiderman"`+
|
|
||||||
`,`+
|
|
||||||
`"static_url":"https://files.example.com/emoji-static/spiderman.png"`+
|
|
||||||
`,`+
|
|
||||||
`"url":"https://files.example.com/emoji/spiderman.png"`+
|
|
||||||
`,`+
|
|
||||||
`"visible_in_picker":true`+
|
|
||||||
`}`+
|
|
||||||
`]`+
|
|
||||||
`,`+
|
|
||||||
`"roles":null`+
|
|
||||||
`,`+
|
|
||||||
`"fields":null`+
|
|
||||||
`}`+
|
|
||||||
`}`,
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
Report: ent.Report{
|
|
||||||
ID: opt.Something("0918273645"),
|
|
||||||
ActionTaken: opt.Something(true),
|
|
||||||
ActionTakenAt: nul.Something("2024-02-27T00:31:59Z"),
|
|
||||||
Category: opt.Something("spam"),
|
|
||||||
Comment: opt.Something("this f-er spamed me"),
|
|
||||||
Forwarded: opt.Something(false),
|
|
||||||
CreatedAt: opt.Something("2023-09-27T00:31:59Z"),
|
|
||||||
StatusIDs: nul.Something(jsonstr.CompileStrings("7823598731", "7916234158", "5218091242")),
|
|
||||||
RuleIDs: nul.Something(jsonstr.CompileStrings("23","1","13","42")),
|
|
||||||
TargetAccount: ent.Account{
|
|
||||||
ID: opt.Something("12345"),
|
|
||||||
UserName: opt.Something("joeblow"),
|
|
||||||
Acct: opt.Something("joeblow@example.com"),
|
|
||||||
DisplayName: opt.Something("Joe Blow :-) :batman:"),
|
|
||||||
Locked: opt.Something(false),
|
|
||||||
Bot: opt.Something(false),
|
|
||||||
Discoverable: opt.Something(true),
|
|
||||||
CreatedAt: opt.Something("2017-02-08T02:00:53.274Z"),
|
|
||||||
Note: opt.Something("<p>I came. I saw. I conquered!</p>"),
|
|
||||||
URL: opt.Something("https://example.com/@joeblow"),
|
|
||||||
URI: opt.Something("https://example.com/users/joeblow"),
|
|
||||||
Avatar: opt.Something("https://files.example.com/avatar/joeblow.png"),
|
|
||||||
AvatarStatic: opt.Something("https://files.example.com/avatar-static/joeblow.png"),
|
|
||||||
Header: opt.Something("https://files.example.com/header/joeblow.png"),
|
|
||||||
HeaderStatic: opt.Something("https://files.example.com/header-static/joeblow/png"),
|
|
||||||
FollowersCount: opt.Something(jsonint.Int64(12345)),
|
|
||||||
FollowingCount: opt.Something(jsonint.Int64(210)),
|
|
||||||
StatusesCount: opt.Something(jsonint.Int64(9876543210)),
|
|
||||||
LastStatusAt: opt.Something("2023-09-27T00:31:59Z"),
|
|
||||||
NoIndex: opt.Something(true),
|
|
||||||
Emojis: []ent.CustomEmoji{
|
|
||||||
ent.CustomEmoji{
|
|
||||||
ShortCode: opt.Something("batman"),
|
|
||||||
URL: opt.Something("https://files.example.com/emoji/batman.png"),
|
|
||||||
StaticURL: opt.Something("https://files.example.com/emoji-static/batman.png"),
|
|
||||||
VisibleInPicker: opt.Something(true),
|
|
||||||
},
|
|
||||||
ent.CustomEmoji{
|
|
||||||
ShortCode: opt.Something("spiderman"),
|
|
||||||
URL: opt.Something("https://files.example.com/emoji/spiderman.png"),
|
|
||||||
StaticURL: opt.Something("https://files.example.com/emoji-static/spiderman.png"),
|
|
||||||
VisibleInPicker: opt.Something(true),
|
|
||||||
Category: opt.Something("spiders"),
|
|
||||||
},
|
|
||||||
ent.CustomEmoji{
|
|
||||||
ShortCode: opt.Something("busooka"),
|
|
||||||
URL: opt.Something("https://files.example.com/emoji/dads-name-for-his-sons-toy.png"),
|
|
||||||
StaticURL: opt.Something("https://files.example.com/emoji-static/dads-name-for-his-sons-toy.png"),
|
|
||||||
VisibleInPicker: opt.Something(false),
|
|
||||||
Category: opt.Something("not-transformers"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Roles: []ent.Role{
|
|
||||||
ent.Role{
|
|
||||||
ID: opt.Something(jsonint.Int64(17)),
|
|
||||||
Name : opt.Something("editor"),
|
|
||||||
Permissions: opt.Something(jsonint.Int64(8)),
|
|
||||||
Highlighted: opt.Something(false),
|
|
||||||
},
|
|
||||||
ent.Role{
|
|
||||||
ID: opt.Something(jsonint.Int64(23)),
|
|
||||||
Name: opt.Something("super-fan"),
|
|
||||||
Color: opt.Something("#dd2211"),
|
|
||||||
Permissions: opt.Something(jsonint.Int64(255)),
|
|
||||||
Highlighted: opt.Something(true),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
//Fields []Field `json:"fields"`
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Expected :
|
|
||||||
`{`+
|
|
||||||
`"id":"0918273645"`+
|
|
||||||
`,`+
|
|
||||||
`"action_taken":true`+
|
|
||||||
`,`+
|
|
||||||
`"action_taken_at":"2024-02-27T00:31:59Z"`+
|
|
||||||
`,`+
|
|
||||||
`"category":"spam"`+
|
|
||||||
`,`+
|
|
||||||
`"comment":"this f-er spamed me"`+
|
|
||||||
`,`+
|
|
||||||
`"forwarded":false`+
|
|
||||||
`,`+
|
|
||||||
`"created_at":"2023-09-27T00:31:59Z"`+
|
|
||||||
`,`+
|
|
||||||
`"status_ids":["7823598731","7916234158","5218091242"]`+
|
|
||||||
`,`+
|
|
||||||
`"rule_ids":["23","1","13","42"]`+
|
|
||||||
`,`+
|
|
||||||
`"target_account":{`+
|
|
||||||
`"id":"12345"`+
|
|
||||||
`,`+
|
|
||||||
`"username":"joeblow"`+
|
|
||||||
`,`+
|
|
||||||
`"acct":"joeblow@example.com"`+
|
|
||||||
`,`+
|
|
||||||
`"display_name":"Joe Blow :-) :batman:"`+
|
|
||||||
`,`+
|
|
||||||
`"locked":false`+
|
|
||||||
`,`+
|
|
||||||
`"bot":false`+
|
|
||||||
`,`+
|
`,`+
|
||||||
`"discoverable":true`+
|
`"discoverable":true`+
|
||||||
`,`+
|
`,`+
|
||||||
`"created_at":"2017-02-08T02:00:53.274Z"`+
|
`"created_at":"2017-02-08T02:00:53.274Z"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"note":"\u003cp\u003eI came. I saw. I conquered!\u003c/p\u003e"`+
|
`"last_status_at":"2023-09-27T00:31:59Z"`+
|
||||||
`,`+
|
`,`+
|
||||||
`"url":"https://example.com/@joeblow"`+
|
`"statuses_count":9876543210`+
|
||||||
`,`+
|
|
||||||
`"uri":"https://example.com/users/joeblow"`+
|
|
||||||
`,`+
|
|
||||||
`"avatar":"https://files.example.com/avatar/joeblow.png"`+
|
|
||||||
`,`+
|
|
||||||
`"avatar_static":"https://files.example.com/avatar-static/joeblow.png"`+
|
|
||||||
`,`+
|
|
||||||
`"header":"https://files.example.com/header/joeblow.png"`+
|
|
||||||
`,`+
|
|
||||||
`"header_static":"https://files.example.com/header-static/joeblow/png"`+
|
|
||||||
`,`+
|
`,`+
|
||||||
`"followers_count":12345`+
|
`"followers_count":12345`+
|
||||||
`,`+
|
`,`+
|
||||||
`"following_count":210`+
|
`"following_count":210`+
|
||||||
`,`+
|
|
||||||
`"statuses_count":9876543210`+
|
|
||||||
`,`+
|
|
||||||
`"last_status_at":"2023-09-27T00:31:59Z"`+
|
|
||||||
`,`+
|
|
||||||
`"noindex":true`+
|
|
||||||
`,`+
|
|
||||||
`"emojis":[`+
|
|
||||||
`{`+
|
|
||||||
`"shortcode":"batman"`+
|
|
||||||
`,`+
|
|
||||||
`"static_url":"https://files.example.com/emoji-static/batman.png"`+
|
|
||||||
`,`+
|
|
||||||
`"url":"https://files.example.com/emoji/batman.png"`+
|
|
||||||
`,`+
|
|
||||||
`"visible_in_picker":true`+
|
|
||||||
`}`+
|
|
||||||
`,`+
|
|
||||||
`{`+
|
|
||||||
`"category":"spiders"`+
|
|
||||||
`,`+
|
|
||||||
`"shortcode":"spiderman"`+
|
|
||||||
`,`+
|
|
||||||
`"static_url":"https://files.example.com/emoji-static/spiderman.png"`+
|
|
||||||
`,`+
|
|
||||||
`"url":"https://files.example.com/emoji/spiderman.png"`+
|
|
||||||
`,`+
|
|
||||||
`"visible_in_picker":true`+
|
|
||||||
`}`+
|
|
||||||
`,`+
|
|
||||||
`{`+
|
|
||||||
`"category":"not-transformers"`+
|
|
||||||
`,`+
|
|
||||||
`"shortcode":"busooka"`+
|
|
||||||
`,`+
|
|
||||||
`"static_url":"https://files.example.com/emoji-static/dads-name-for-his-sons-toy.png"`+
|
|
||||||
`,`+
|
|
||||||
`"url":"https://files.example.com/emoji/dads-name-for-his-sons-toy.png"`+
|
|
||||||
`,`+
|
|
||||||
`"visible_in_picker":false`+
|
|
||||||
`}`+
|
|
||||||
`]`+
|
|
||||||
`,`+
|
|
||||||
`"roles":[`+
|
|
||||||
`{`+
|
|
||||||
`"id":17`+
|
|
||||||
`,`+
|
|
||||||
`"name":"editor"`+
|
|
||||||
`,`+
|
|
||||||
`"color":""`+
|
|
||||||
`,`+
|
|
||||||
`"permissions":8`+
|
|
||||||
`,`+
|
|
||||||
`"highlighted":false`+
|
|
||||||
`}`+
|
|
||||||
`,`+
|
|
||||||
`{`+
|
|
||||||
`"id":23`+
|
|
||||||
`,`+
|
|
||||||
`"name":"super-fan"`+
|
|
||||||
`,`+
|
|
||||||
`"color":"#dd2211"`+
|
|
||||||
`,`+
|
|
||||||
`"permissions":255`+
|
|
||||||
`,`+
|
|
||||||
`"highlighted":true`+
|
|
||||||
`}`+
|
|
||||||
`]`+
|
|
||||||
`,`+
|
|
||||||
`"fields":null`+
|
|
||||||
`}`+
|
`}`+
|
||||||
`}`,
|
`}`,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue