Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Oct 9, 2024
1 parent 9e15040 commit 4382d81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion front/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ func (h *Handler) PrintNote(w text.Writer, r *Request, note *ap.Object, author *
} else if bookmarked == 0 {
w.Link("/users/bookmark/"+strings.TrimPrefix(note.ID, "https://"), "🔖 Bookmark")
} else {
w.Link("/users/unbookmark/"+strings.TrimPrefix(note.ID, "https://"), "💣 Unbookmark")
w.Link("/users/unbookmark/"+strings.TrimPrefix(note.ID, "https://"), "🔖 Unbookmark")
}
}

Expand Down
6 changes: 3 additions & 3 deletions test/bookmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestBookmark_HappyFlow(t *testing.T) {

view := strings.Split(server.Handle("/users/view/"+say[15:len(say)-2], server.Bob), "\n")
assert.Contains(view, fmt.Sprintf("=> /users/bookmark/%s 🔖 Bookmark", say[15:len(say)-2]))
assert.NotContains(view, fmt.Sprintf("=> /users/unbookmark/%s 💣️ Unbookmark", say[15:len(say)-2]))
assert.NotContains(view, fmt.Sprintf("=> /users/unbookmark/%s 🔖 Unbookmark", say[15:len(say)-2]))

bookmarks := strings.Split(server.Handle("/users/bookmarks", server.Bob), "\n")
assert.Contains(bookmarks, "No posts.")
Expand All @@ -49,7 +49,7 @@ func TestBookmark_HappyFlow(t *testing.T) {

view = strings.Split(server.Handle("/users/view/"+say[15:len(say)-2], server.Bob), "\n")
assert.NotContains(view, fmt.Sprintf("=> /users/bookmark/%s 🔖 Bookmark", say[15:len(say)-2]))
assert.Contains(view, fmt.Sprintf("=> /users/unbookmark/%s 💣️ Unbookmark", say[15:len(say)-2]))
assert.Contains(view, fmt.Sprintf("=> /users/unbookmark/%s 🔖 Unbookmark", say[15:len(say)-2]))

unbookmark := server.Handle("/users/unbookmark/"+say[15:len(say)-2], server.Bob)
assert.Equal(fmt.Sprintf("30 /users/view/%s\r\n", say[15:len(say)-2]), unbookmark)
Expand All @@ -60,7 +60,7 @@ func TestBookmark_HappyFlow(t *testing.T) {

view = strings.Split(server.Handle("/users/view/"+say[15:len(say)-2], server.Bob), "\n")
assert.Contains(view, fmt.Sprintf("=> /users/bookmark/%s 🔖 Bookmark", say[15:len(say)-2]))
assert.NotContains(view, fmt.Sprintf("=> /users/unbookmark/%s 💣️ Unbookmark", say[15:len(say)-2]))
assert.NotContains(view, fmt.Sprintf("=> /users/unbookmark/%s 🔖 Unbookmark", say[15:len(say)-2]))
}

func TestBookmark_Throttling(t *testing.T) {
Expand Down

0 comments on commit 4382d81

Please sign in to comment.