dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 27f0503e09aa399d9249dae06f5f20b50866324c
parent 0efe1f7bf109d414fddd1733afa6de09439ed52a
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sun, 19 Mar 2023 02:23:10 -0700

fix tests

Diffstat:
Mpkg/web/handlers/api/v1/topBarHandler_test.go | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkg/web/handlers/api/v1/topBarHandler_test.go b/pkg/web/handlers/api/v1/topBarHandler_test.go @@ -101,17 +101,17 @@ EsRtZTXRbbiR809TVRcFOn5iro5Ez6Q6K1d7fRwtfwEAz7cX1RUfG0r5cwM03/RG func TestGetQuoteTxt(t *testing.T) { // Quotes do not include original message quote if any - txt := getQuoteTxt("", database.ChatMessage{RawMessage: `“[00:00:01] user1 - this is a test” another one`, User: database.User{Username: "user1"}, CreatedAt: time.Date(0, 0, 0, 0, 0, 2, 0, time.UTC)}) + txt := getQuoteTxt(nil, "", database.ChatMessage{RawMessage: `“[00:00:01] user1 - this is a test” another one`, User: database.User{Username: "user1"}, CreatedAt: time.Date(0, 0, 0, 0, 0, 2, 0, time.UTC)}) expected := "“[00:00:02] user1 - another one”" assert.Equal(t, expected, txt) // Quoted should inline a multiline message - txt = getQuoteTxt("", database.ChatMessage{RawMessage: "line1\nline2\nline3", User: database.User{Username: "user1"}, CreatedAt: time.Date(0, 0, 0, 0, 0, 2, 0, time.UTC)}) + txt = getQuoteTxt(nil, "", database.ChatMessage{RawMessage: "line1\nline2\nline3", User: database.User{Username: "user1"}, CreatedAt: time.Date(0, 0, 0, 0, 0, 2, 0, time.UTC)}) expected = "“[00:00:02] user1 - line1 line2 line3”" assert.Equal(t, expected, txt) // Quoted should replace "special double quotes" to normal "double quote" - txt = getQuoteTxt("", database.ChatMessage{RawMessage: `instead of showing + txt = getQuoteTxt(nil, "", database.ChatMessage{RawMessage: `instead of showing “[00:00:01] user2 - an article about HHVM... https://www.zapbuild.com/bitsntricks/hiphop-…” that looks perfect for my chat i think it would be better if it shows