Use the same widget for books everywhere
This commit is contained in:
@@ -60,14 +60,14 @@ func TestGetReadBooksHandler_CheckOneBook(t *testing.T) {
|
||||
|
||||
token := testutils.ConnectDemo2User(router)
|
||||
result := testGetReadBooksHandler(t, router, token, 200, "100", "")
|
||||
var book dto.BookUserGetBook
|
||||
var book dto.BookItemGet
|
||||
for _, b := range result.Books {
|
||||
if b.Title == "De sang-froid" {
|
||||
book = b
|
||||
}
|
||||
}
|
||||
assert.Equal(t,
|
||||
dto.BookUserGetBook{
|
||||
dto.BookItemGet{
|
||||
ID: 18,
|
||||
Title: "De sang-froid",
|
||||
Author: "Truman Capote",
|
||||
@@ -77,7 +77,7 @@ func TestGetReadBooksHandler_CheckOneBook(t *testing.T) {
|
||||
}, book)
|
||||
}
|
||||
|
||||
func testGetReadBooksHandler(t *testing.T, router *gin.Engine, userToken string, expectedCode int, limit string, offset string) dto.BookUserGet {
|
||||
func testGetReadBooksHandler(t *testing.T, router *gin.Engine, userToken string, expectedCode int, limit string, offset string) dto.BookItemsGet {
|
||||
u, err := url.Parse("/ws/mybooks/read")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
|
||||
Reference in New Issue
Block a user