clone

a self-hosted multitenant nostr relay with sites, file storage, git hosting, and inbox and outbox delivery

assert the edited text on the room page test

Dami committed f8e54b2
commit
f8e54b2a8cfb72f50db1b39123e749ef079fee90
parent
d78d443c4d8102417ad6dd958aa150e0dd439e8e
author
Dami <dami.etoile@gmail.com>
1 file changed, +3 -3
Minternal/webui/rooms_test.go6+++---
M internal/webui/rooms_test.go +3 -3
@@ -73,7 +73,7 @@ func (b *roomsBackend) Query(_ context.Context, method string, params []json.Raw
7373 return map[string]any{"room": roomRecord(id, "General", "open", ""), "root": root, "replies": []any{reply}, "next_cursor": ""}, nil7474 }7575 messages := []any{76- roomEvent(strings.Repeat("a", 64), roomAgent, 40003, 1757203650, "hello again, edited", []string{"h", id}, []string{"e", roomHello}),76+ roomEvent(strings.Repeat("a", 64), roomAgent, 40003, 1757203650, "hello again, see https://example.com/docs. and nostr:npub1ttrypewl3au52wqux86r22yt506c077k3maj02a0jste97wrvd5sjfutc2", []string{"h", id}, []string{"e", roomHello}),7777 roomEvent(strings.Repeat("b", 64), roomOwner, 40003, 1757203660, "not my message", []string{"h", id}, []string{"e", roomHello}),7878 roomEvent(roomLike, roomOwner, 7, 1757203600, "+", []string{"h", id}, []string{"e", roomChat}),7979 reply,
@@ -142,13 +142,13 @@ func TestRoomPageRendersMessagesOldestFirstWithMarkers(t *testing.T) {
142142 for _, want := range []string{143143 `<h1>General <small>open room</small></h1>`, `<p>Where General happens.</p>`,144144 `<a href="/rooms/general?cursor=cursor-1">load earlier</a>`,145- `<room-message id="msg-` + roomHello + `" data-id="` + roomHello + `" data-kind="9" data-pubkey="` + roomAgent + `" data-agent>`,145+ `<room-message id="msg-` + roomHello + `" data-id="` + roomHello + `" data-kind="9" data-pubkey="` + roomAgent + `" data-agent data-edited>`,146146 `<a href="https://example.com/docs" rel="noopener">https://example.com/docs</a>.`,147147 `<a href="/open?target=nostr%3Anpub1ttrypewl3au52wqux86r22yt506c077k3maj02a0jste97wrvd5sjfutc2">nostr:npub1`,148148 `&lt;script&gt;alert(1)&lt;/script&gt;`,149149 `<span>to <nostr-key hex="` + roomAgent + `"`,150150 `<span data-reaction="&#43;1">&#43;1 1</span>`,151- `data-pubkey="` + roomAgent + `" data-agent data-edited>`, `<p>hello again, edited</p>`, `<span data-edited>edited</span>`,151+ `<p>hello again, see <a href="https://example.com/docs" rel="noopener">`, `<span data-edited>edited</span>`,152152 `<a href="/rooms/general/thread/` + roomThread + `">thread | 1 reply</a>`,153153 `<a href="/rooms/general/thread/` + roomThread + `">in thread</a>`,154154 `<room-live room="general"></room-live>`,