From 4a084cedfd972c4ea0f8081965693d67811f14df Mon Sep 17 00:00:00 2001 From: Nicolas Perriault Date: Thu, 26 Sep 2024 11:14:24 +0200 Subject: [PATCH] refactor: clean test code. --- tests/Server/ServerTest.elm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/Server/ServerTest.elm b/tests/Server/ServerTest.elm index 35dba9f3c..1ec14178e 100644 --- a/tests/Server/ServerTest.elm +++ b/tests/Server/ServerTest.elm @@ -68,19 +68,17 @@ suite = request : StaticDb.Db -> String -> Encode.Value -> String -> Request request dbs method body url = + let + encode encoder = + Encode.list encoder >> Encode.encode 0 + in { method = method , url = url , body = body , processes = - { foodProcesses = - Encode.list FoodProcess.encode dbs.food.processes - |> Encode.encode 0 - , objectProcesses = - Encode.list ObjectProcess.encode dbs.object.processes - |> Encode.encode 0 - , textileProcesses = - Encode.list TextileProcess.encode dbs.textile.processes - |> Encode.encode 0 + { foodProcesses = dbs.food.processes |> encode FoodProcess.encode + , objectProcesses = dbs.object.processes |> encode ObjectProcess.encode + , textileProcesses = dbs.textile.processes |> encode TextileProcess.encode } , jsResponseHandler = Encode.null }