summaryrefslogtreecommitdiff
path: root/internal/text/formatter_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-11-22 11:49:11 +0100
committerLibravatar GitHub <noreply@github.com>2021-11-22 11:49:11 +0100
commit24f9e1122111a73fbd49c46e0f137ddb0f5d45eb (patch)
tree1b0ef83ac79ec13bdb015837f05d1144a293a333 /internal/text/formatter_test.go
parentadd bindAddress configuration option (#320) (diff)
downloadgotosocial-24f9e1122111a73fbd49c46e0f137ddb0f5d45eb.tar.xz
Fix image description unnecessarily html-escaping innocent characters (#321)
* implement SanitizeCaption function * tidy up text test setup
Diffstat (limited to 'internal/text/formatter_test.go')
-rw-r--r--internal/text/formatter_test.go26
1 files changed, 25 insertions, 1 deletions
diff --git a/internal/text/formatter_test.go b/internal/text/formatter_test.go
index d01f1418e..8b4d176e2 100644
--- a/internal/text/formatter_test.go
+++ b/internal/text/formatter_test.go
@@ -24,9 +24,9 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/text"
+ "github.com/superseriousbusiness/gotosocial/testrig"
)
-// nolint
type TextStandardTestSuite struct {
// standard suite interfaces
suite.Suite
@@ -47,3 +47,27 @@ type TextStandardTestSuite struct {
// module being tested
formatter text.Formatter
}
+
+func (suite *TextStandardTestSuite) SetupSuite() {
+ suite.testTokens = testrig.NewTestTokens()
+ suite.testClients = testrig.NewTestClients()
+ suite.testApplications = testrig.NewTestApplications()
+ suite.testUsers = testrig.NewTestUsers()
+ suite.testAccounts = testrig.NewTestAccounts()
+ suite.testAttachments = testrig.NewTestAttachments()
+ suite.testStatuses = testrig.NewTestStatuses()
+ suite.testTags = testrig.NewTestTags()
+ suite.testMentions = testrig.NewTestMentions()
+}
+
+func (suite *TextStandardTestSuite) SetupTest() {
+ suite.config = testrig.NewTestConfig()
+ suite.db = testrig.NewTestDB()
+ suite.formatter = text.NewFormatter(suite.config, suite.db)
+
+ testrig.StandardDBSetup(suite.db, nil)
+}
+
+func (suite *TextStandardTestSuite) TearDownTest() {
+ testrig.StandardDBTeardown(suite.db)
+}