From 21162cc63e6b78336efcf394227913b2ceaa267c Mon Sep 17 00:00:00 2001 From: Arthur Lefebvre Date: Mon, 2 Feb 2026 18:09:46 +0100 Subject: [PATCH] fixed unit testing: search by ISBN --- internal/apitest/search_book_test.go | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/apitest/search_book_test.go b/internal/apitest/search_book_test.go index 77b61b8..4eb9b50 100644 --- a/internal/apitest/search_book_test.go +++ b/internal/apitest/search_book_test.go @@ -67,21 +67,21 @@ func TestSearchBook_OneBookRead(t *testing.T) { result.Books) } -//func TestSearchBook_ISBN(t *testing.T) { -// result := testSearchBook(t, "9782070337903", "", "") -// assert.Equal(t, int64(1), result.Count) -// assert.Equal(t, -// []bookSearchGetBook{{ -// Title: "Le complot contre l'Amérique", -// Author: "Philip Roth", -// Id: 22, -// Rating: 6, -// Read: true, -// WantRead: false, -// CoverPath: "/bookcover/lecomplotcontrelamerique.jpg", -// }}, -// result) -//} +func TestSearchBook_ISBN(t *testing.T) { + result := testSearchBook(t, "9782070337903", "", "") + assert.Equal(t, int64(1), result.Count) + assert.Equal(t, + []bookSearchGetBook{{ + Title: "Le complot contre l'Amérique", + Author: "Philip Roth", + Id: 22, + Rating: 6, + Read: true, + WantRead: false, + CoverPath: "/bookcover/lecomplotcontrelamerique.jpg", + }}, + result.Books) +} func TestSearchBook_Limit(t *testing.T) { result := testSearchBook(t, "a", "10", "")