From 0e29f1f5bb68a48d9b837d7f4e0a16370734955b Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Tue, 9 May 2023 12:16:10 +0200 Subject: [feature] Enable federation in/out of profile PropertyValue fields (#1722) Co-authored-by: kim Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> --- internal/text/plain_test.go | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'internal/text/plain_test.go') diff --git a/internal/text/plain_test.go b/internal/text/plain_test.go index c00ae70c3..5a2918563 100644 --- a/internal/text/plain_test.go +++ b/internal/text/plain_test.go @@ -25,14 +25,16 @@ import ( ) const ( - simple = "this is a plain and simple status" - simpleExpected = "

this is a plain and simple status

" - withTag = "here's a simple status that uses hashtag #welcome!" - withTagExpected = "

here's a simple status that uses hashtag #welcome!

" - withHTML = "
blah this should just be html escaped blah
" - withHTMLExpected = "

<div>blah this should just be html escaped blah</div>

" - moreComplex = "Another test @foss_satan@fossbros-anonymous.io\n\n#Hashtag\n\nText\n\n:rainbow:" - moreComplexExpected = "

Another test @foss_satan

#Hashtag

Text

:rainbow:

" + simple = "this is a plain and simple status" + simpleExpected = "

this is a plain and simple status

" + simpleExpectedNoParagraph = "this is a plain and simple status" + withTag = "here's a simple status that uses hashtag #welcome!" + withTagExpected = "

here's a simple status that uses hashtag #welcome!

" + withTagExpectedNoParagraph = "here's a simple status that uses hashtag #welcome!" + withHTML = "
blah this should just be html escaped blah
" + withHTMLExpected = "

<div>blah this should just be html escaped blah</div>

" + moreComplex = "Another test @foss_satan@fossbros-anonymous.io\n\n#Hashtag\n\nText\n\n:rainbow:" + moreComplexExpected = "

Another test @foss_satan

#Hashtag

Text

:rainbow:

" ) type PlainTestSuite struct { @@ -44,11 +46,21 @@ func (suite *PlainTestSuite) TestParseSimple() { suite.Equal(simpleExpected, formatted.HTML) } +func (suite *PlainTestSuite) TestParseSimpleNoParagraph() { + formatted := suite.FromPlainNoParagraph(simple) + suite.Equal(simpleExpectedNoParagraph, formatted.HTML) +} + func (suite *PlainTestSuite) TestParseWithTag() { formatted := suite.FromPlain(withTag) suite.Equal(withTagExpected, formatted.HTML) } +func (suite *PlainTestSuite) TestParseWithTagNoParagraph() { + formatted := suite.FromPlainNoParagraph(withTag) + suite.Equal(withTagExpectedNoParagraph, formatted.HTML) +} + func (suite *PlainTestSuite) TestParseWithHTML() { formatted := suite.FromPlain(withHTML) suite.Equal(withHTMLExpected, formatted.HTML) -- cgit v1.2.3