mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Parse content warning to HTML, serialize via client API as plaintext (#3876)
* [feature] Parse content warning as HTML, serialize via API to plaintext * tidy up some cruft * whoops * oops * i'm da joker baybee * clemency muy lorde * rename some of the text functions for clarity * jiggle the opts * fiddle de deee * hopefully the last test fix i ever have to do in my beautiful life
This commit is contained in:
@@ -508,7 +508,7 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() {
|
||||
"muted": false,
|
||||
"bookmarked": false,
|
||||
"pinned": false,
|
||||
"content": "dark souls status bot: \"thoughts of dog\"",
|
||||
"content": "\u003cp\u003edark souls status bot: \"thoughts of dog\"\u003c/p\u003e",
|
||||
"reblog": null,
|
||||
"account": {
|
||||
"id": "01F8MH5ZK5VRH73AKHQM6Y9VNX",
|
||||
@@ -765,7 +765,7 @@ func (suite *ReportsGetTestSuite) TestReportsGetCreatedByAccount() {
|
||||
"muted": false,
|
||||
"bookmarked": false,
|
||||
"pinned": false,
|
||||
"content": "dark souls status bot: \"thoughts of dog\"",
|
||||
"content": "\u003cp\u003edark souls status bot: \"thoughts of dog\"\u003c/p\u003e",
|
||||
"reblog": null,
|
||||
"account": {
|
||||
"id": "01F8MH5ZK5VRH73AKHQM6Y9VNX",
|
||||
@@ -1022,7 +1022,7 @@ func (suite *ReportsGetTestSuite) TestReportsGetTargetAccount() {
|
||||
"muted": false,
|
||||
"bookmarked": false,
|
||||
"pinned": false,
|
||||
"content": "dark souls status bot: \"thoughts of dog\"",
|
||||
"content": "\u003cp\u003edark souls status bot: \"thoughts of dog\"\u003c/p\u003e",
|
||||
"reblog": null,
|
||||
"account": {
|
||||
"id": "01F8MH5ZK5VRH73AKHQM6Y9VNX",
|
||||
|
@@ -916,7 +916,7 @@ func (suite *SearchGetTestSuite) TestSearchAAny() {
|
||||
}
|
||||
|
||||
suite.Len(searchResult.Accounts, 5)
|
||||
suite.Len(searchResult.Statuses, 8)
|
||||
suite.Len(searchResult.Statuses, 9)
|
||||
suite.Len(searchResult.Hashtags, 0)
|
||||
}
|
||||
|
||||
@@ -959,7 +959,7 @@ func (suite *SearchGetTestSuite) TestSearchAAnyFollowingOnly() {
|
||||
}
|
||||
|
||||
suite.Len(searchResult.Accounts, 2)
|
||||
suite.Len(searchResult.Statuses, 8)
|
||||
suite.Len(searchResult.Statuses, 9)
|
||||
suite.Len(searchResult.Hashtags, 0)
|
||||
}
|
||||
|
||||
@@ -1002,7 +1002,7 @@ func (suite *SearchGetTestSuite) TestSearchAStatuses() {
|
||||
}
|
||||
|
||||
suite.Len(searchResult.Accounts, 0)
|
||||
suite.Len(searchResult.Statuses, 8)
|
||||
suite.Len(searchResult.Statuses, 9)
|
||||
suite.Len(searchResult.Hashtags, 0)
|
||||
}
|
||||
|
||||
|
@@ -144,7 +144,7 @@ func (suite *StatusBoostTestSuite) TestPostBoost() {
|
||||
},
|
||||
"bookmarked": true,
|
||||
"card": null,
|
||||
"content": "hello world! #welcome ! first post on the instance :rainbow: !",
|
||||
"content": "<p>hello world! <a href=\"http://localhost:8080/tags/welcome\" class=\"mention hashtag\" rel=\"tag nofollow noreferrer noopener\" target=\"_blank\">#<span>welcome</span></a> ! first post on the instance :rainbow: !</p>",
|
||||
"content_type": "text/plain",
|
||||
"created_at": "right the hell just now babyee",
|
||||
"edited_at": null,
|
||||
@@ -331,7 +331,7 @@ func (suite *StatusBoostTestSuite) TestPostBoostOwnFollowersOnly() {
|
||||
},
|
||||
"bookmarked": false,
|
||||
"card": null,
|
||||
"content": "hi!",
|
||||
"content": "<p>hi!</p>",
|
||||
"content_type": "text/plain",
|
||||
"created_at": "right the hell just now babyee",
|
||||
"edited_at": null,
|
||||
|
@@ -103,7 +103,7 @@ func (suite *StatusFaveTestSuite) TestPostFave() {
|
||||
},
|
||||
"bookmarked": false,
|
||||
"card": null,
|
||||
"content": "🐕🐕🐕🐕🐕",
|
||||
"content": "<p>🐕🐕🐕🐕🐕</p>",
|
||||
"content_type": "text/plain",
|
||||
"created_at": "right the hell just now babyee",
|
||||
"edited_at": null,
|
||||
|
@@ -91,7 +91,7 @@ func (suite *StatusHistoryTestSuite) TestGetHistory() {
|
||||
|
||||
suite.Equal(`[
|
||||
{
|
||||
"content": "hello everyone!",
|
||||
"content": "\u003cp\u003ehello everyone!\u003c/p\u003e",
|
||||
"spoiler_text": "introduction post",
|
||||
"sensitive": true,
|
||||
"created_at": "2021-10-20T10:40:37.000Z",
|
||||
|
@@ -108,7 +108,7 @@ func (suite *StatusMuteTestSuite) TestMuteUnmuteStatus() {
|
||||
"muted": true,
|
||||
"bookmarked": false,
|
||||
"pinned": false,
|
||||
"content": "hello everyone!",
|
||||
"content": "\u003cp\u003ehello everyone!\u003c/p\u003e",
|
||||
"reblog": null,
|
||||
"application": {
|
||||
"name": "really cool gts application",
|
||||
@@ -198,7 +198,7 @@ func (suite *StatusMuteTestSuite) TestMuteUnmuteStatus() {
|
||||
"muted": false,
|
||||
"bookmarked": false,
|
||||
"pinned": false,
|
||||
"content": "hello everyone!",
|
||||
"content": "\u003cp\u003ehello everyone!\u003c/p\u003e",
|
||||
"reblog": null,
|
||||
"application": {
|
||||
"name": "really cool gts application",
|
||||
|
@@ -129,7 +129,6 @@ func (suite *StatusUnfaveTestSuite) TestPostAlreadyNotFaved() {
|
||||
err = json.Unmarshal(b, statusReply)
|
||||
assert.NoError(suite.T(), err)
|
||||
|
||||
assert.Equal(suite.T(), targetStatus.ContentWarning, statusReply.SpoilerText)
|
||||
assert.Equal(suite.T(), targetStatus.Content, statusReply.Content)
|
||||
assert.True(suite.T(), statusReply.Sensitive)
|
||||
assert.Equal(suite.T(), apimodel.VisibilityPublic, statusReply.Visibility)
|
||||
|
Reference in New Issue
Block a user