Commit 5edf523d authored by Bas Lijnse's avatar Bas Lijnse Committed by Steffen Michels

Updated test utils and tests

parent 1bbe8add
......@@ -83,7 +83,7 @@ filterTestsByName pattern tests = filter (\{UnitTest|name} -> indexOf pattern na
//UTILITY TASKS
testEditor :: (Editor a) (EditMode a) -> Task a | iTask a
testEditor editor mode
= (interactR unitShare {onInit = const ((),mode), onEdit = \v l -> (l,Nothing), onRefresh = \_ l v -> (l,v,Nothing)} editor @ snd
= (interactR unitShare {onInit = const mode, onEdit = \v -> Nothing, onRefresh = \_ v -> (v,Nothing)} editor @ snd
>&> \s -> Title "Editor value" @>> viewSharedInformation [ViewAs (toString o toJSON)] s @? tvFromMaybe
) <<@ ArrangeHorizontal
......@@ -92,9 +92,9 @@ testEditorWithShare editor model viewMode = (withShared model
\smodel ->
(Hint "Edit the shared source" @>> updateSharedInformation [] smodel)
||-
(Title "Editor under test" @>> interactR smodel {onInit = \r -> ((),if viewMode View Update $ r)
,onEdit = \v l -> (l,Just (\_ -> v))
,onRefresh = \r l _ -> (l,Just r,Nothing)} editor @ snd)
(Title "Editor under test" @>> interactR smodel {onInit = \r -> (if viewMode View Update $ r)
,onEdit = \v -> (Just (\_ -> v))
,onRefresh = \r _ -> (Just r,Nothing)} editor @ snd)
) <<@ ArrangeHorizontal
testCommonInteractions :: String -> Task a | iTask, gDefault{|*|} a
......
......@@ -11,7 +11,7 @@ minimalInteractUI = skip (testTaskOutput "Initial UI of minimal interaction task
where
task :: Task ((),String)
task = interactR unitShare handlers gEditor{|*|}
handlers = {onInit = \() -> ((),Update "Hello world"), onEdit = \_ l -> (l,Nothing), onRefresh = \_ l v -> (l,v,Nothing)}
handlers = {onInit = \() -> Update "Hello world", onEdit = \_ -> Nothing, onRefresh = \_ v -> (v,Nothing)}
events = [Left ResetEvent]
exp = [TOUIChange (ReplaceUI expMinimalEditorUI)]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment