summaryrefslogtreecommitdiff
path: root/testrig
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-08-11 16:54:54 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-11 16:54:54 +0200
commit329a5e8144eea78e607c8a218ae78ae8f346f2e8 (patch)
tree73072075ad682212d77504d4199ae756f4950a60 /testrig
parentahhh (diff)
downloadgotosocial-329a5e8144eea78e607c8a218ae78ae8f346f2e8.tar.xz
Text duplication fix (#137)
* start testing text duplication * tests * fixes + tests
Diffstat (limited to 'testrig')
-rw-r--r--testrig/db.go6
-rw-r--r--testrig/testmodels.go54
2 files changed, 60 insertions, 0 deletions
diff --git a/testrig/db.go b/testrig/db.go
index fe38c3164..f34f7936b 100644
--- a/testrig/db.go
+++ b/testrig/db.go
@@ -141,6 +141,12 @@ func StandardDBSetup(db db.DB, accounts map[string]*gtsmodel.Account) {
}
}
+ for _, v := range NewTestMentions() {
+ if err := db.Put(v); err != nil {
+ panic(err)
+ }
+ }
+
for _, v := range NewTestFaves() {
if err := db.Put(v); err != nil {
panic(err)
diff --git a/testrig/testmodels.go b/testrig/testmodels.go
index da5cbe7af..77274474c 100644
--- a/testrig/testmodels.go
+++ b/testrig/testmodels.go
@@ -937,6 +937,31 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
},
ActivityStreamsType: gtsmodel.ActivityStreamsNote,
},
+ "local_account_1_status_5": {
+ ID: "01FCTA44PW9H1TB328S9AQXKDS",
+ URI: "http://localhost:8080/users/the_mighty_zork/statuses/01FCTA44PW9H1TB328S9AQXKDS",
+ URL: "http://localhost:8080/@the_mighty_zork/statuses/01FCTA44PW9H1TB328S9AQXKDS",
+ Content: "hi!",
+ Attachments: []string{},
+ CreatedAt: time.Now().Add(-1 * time.Minute),
+ UpdatedAt: time.Now().Add(-1 * time.Minute),
+ Local: true,
+ AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
+ InReplyToID: "",
+ BoostOfID: "",
+ ContentWarning: "",
+ Visibility: gtsmodel.VisibilityMutualsOnly,
+ Sensitive: false,
+ Language: "en",
+ CreatedWithApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG",
+ VisibilityAdvanced: &gtsmodel.VisibilityAdvanced{
+ Federated: true,
+ Boostable: true,
+ Replyable: true,
+ Likeable: true,
+ },
+ ActivityStreamsType: gtsmodel.ActivityStreamsNote,
+ },
"local_account_2_status_1": {
ID: "01F8MHBQCBTDKN6X5VHGMMN4MA",
URI: "http://localhost:8080/users/1happyturtle/statuses/01F8MHBQCBTDKN6X5VHGMMN4MA",
@@ -1076,6 +1101,35 @@ func NewTestTags() map[string]*gtsmodel.Tag {
Listable: true,
LastStatusAt: time.Now().Add(-71 * time.Hour),
},
+ "Hashtag": {
+ ID: "01FCT9SGYA71487N8D0S1M638G",
+ URL: "http://localhost:8080/tags/Hashtag",
+ Name: "Hashtag",
+ FirstSeenFromAccountID: "",
+ CreatedAt: time.Now().Add(-71 * time.Hour),
+ UpdatedAt: time.Now().Add(-71 * time.Hour),
+ Useable: true,
+ Listable: true,
+ LastStatusAt: time.Now().Add(-71 * time.Hour),
+ },
+ }
+}
+
+// NewTestMentions returns a map of gts model mentions keyed by their name.
+func NewTestMentions() map[string]*gtsmodel.Mention {
+ return map[string]*gtsmodel.Mention{
+ "zork_mention_foss_satan": {
+ ID: "01FCTA2Y6FGHXQA4ZE6N5NMNEX",
+ StatusID: "01FCTA44PW9H1TB328S9AQXKDS",
+ CreatedAt: time.Now().Add(-1 * time.Minute),
+ UpdatedAt: time.Now().Add(-1 * time.Minute),
+ OriginAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
+ OriginAccountURI: "http://localhost:8080/users/the_mighty_zork",
+ TargetAccountID: "01F8MH5ZK5VRH73AKHQM6Y9VNX",
+ NameString: "@foss_satan@fossbros-anonymous.io",
+ MentionedAccountURI: "http://fossbros-anonymous.io/users/foss_satan",
+ MentionedAccountURL: "http://fossbros-anonymous.io/@foss_satan",
+ },
}
}