| author | Stephen Paul Weber
<singpolyma@singpolyma.net> 2025-03-18 19:48:49 UTC |
| committer | Stephen Paul Weber
<singpolyma@singpolyma.net> 2025-03-18 19:48:49 UTC |
| parent | 6a47608884d8a33a48ece236158d5fe24f6a5ba5 |
| test/TestAll.hx | +1 | -1 |
| test/{TestChatMessage.hx => TestChatMessageBuilder.hx} | +5 | -5 |
diff --git a/test/TestAll.hx b/test/TestAll.hx index 1c11a8f..b0e51ac 100644 --- a/test/TestAll.hx +++ b/test/TestAll.hx @@ -7,7 +7,7 @@ class TestAll { public static function main() { utest.UTest.run([ new TestSessionDescription(), - new TestChatMessage(), + new TestChatMessageBuilder(), new TestStanza(), ]); } diff --git a/test/TestChatMessage.hx b/test/TestChatMessageBuilder.hx similarity index 82% rename from test/TestChatMessage.hx rename to test/TestChatMessageBuilder.hx index 904dc09..c8e3603 100644 --- a/test/TestChatMessage.hx +++ b/test/TestChatMessageBuilder.hx @@ -2,11 +2,11 @@ package test; import utest.Assert; import utest.Async; -import snikket.ChatMessage; +import snikket.ChatMessageBuilder; -class TestChatMessage extends utest.Test { +class TestChatMessageBuilder extends utest.Test { public function testConvertHtmlToXHTML() { - final msg = new ChatMessage(); + final msg = new ChatMessageBuilder(); msg.setHtml("Hello <div><img src='hai'><br>"); Assert.equals( "<html xmlns=\"http://jabber.org/protocol/xhtml-im\"><body xmlns=\"http://www.w3.org/1999/xhtml\">Hello <div><img src=\"hai\"/><br/></div></body></html>", @@ -15,7 +15,7 @@ class TestChatMessage extends utest.Test { } public function testConvertHtmlToText() { - final msg = new ChatMessage(); + final msg = new ChatMessageBuilder(); msg.setHtml("<blockquote>Hello<br>you</blockquote><img alt=':boop:'><br><b>hi</b> <em>hi</em> <s>hey</s> <tt>up</tt><pre>hello<br>you"); Assert.equals( "> Hello\n> you\n:boop:\n*hi* _hi_ ~hey~ `up`\n```\nhello\nyou\n```\n", @@ -24,7 +24,7 @@ class TestChatMessage extends utest.Test { } public function testConvertHtmlToXHTMLIgnoresBody() { - final msg = new ChatMessage(); + final msg = new ChatMessageBuilder(); msg.setHtml("<body>Hello <div><img src='hai'><br></body>"); Assert.equals( "<html xmlns=\"http://jabber.org/protocol/xhtml-im\"><body xmlns=\"http://www.w3.org/1999/xhtml\">Hello <div><img src=\"hai\"/><br/></div></body></html>",