😑 using search-a-licious API now...

This commit is contained in:
cdricms
2025-12-06 18:43:14 +01:00
parent 44420002c7
commit dd191b585d
7 changed files with 35 additions and 23 deletions

View File

@@ -35,15 +35,15 @@ final class OpenFoodFactsTests: XCTestCase {
func testSearch() async throws {
let response = try await client.search(
.query("chocolate"),
.tag(tag: .brands, value: "milka"),
// .tag(tag: .brands, value: "milka"),
.pageSize(5),
.sort(.popularity),
// .sort(.popularity),
)
let results = response.products
let results = response.hits
let jsonResults = try JSONEncoder().encode(results)
_ = jsonResults
try jsonResults.write(to: .init(filePath: "./jsonResults.json"))
XCTAssertFalse(results.isEmpty)
XCTAssertEqual(results.count, 5)