diff options
author | Vitaly Takmazov | 2024-04-27 19:54:16 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2024-04-27 21:45:00 +0300 |
commit | f2421c1e8ed0a0c8392b179435d638ff55fe1551 (patch) | |
tree | c95ec31b18ec23498408b4c34a351dcfbb4c2cdd /src/test | |
parent | 57fae6b2d4e2f94e49a3b809a47ef4abc2a1ef80 (diff) |
Fix text truncation in reply quotes and Twitter posts
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index a728ac2b..d61725e6 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -2693,4 +2693,11 @@ public class ServerTests { .with(httpBasic(ugnichName, ugnichPassword))) .andExpect(status().isBadRequest()); } + @Test + public void textTruncationShouldNotBreakEmojis() { + var text = "Так ты же написал, чтоб я сам поправил отступ \uD83D\uDE00\n"; + var expected = "Так ты же написал, чтоб я сам поправил отступ"; + var truncated = PlainTextFormatter.truncateText(text, 47); + assertThat(truncated, is(expected)); + } } |