File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
test/Spec/BotPlutusInterface Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ withoutSigning = do
330330 submitTx constraints
331331
332332 -- Building and siging the tx should include both signing keys
333- assertContractWithTxId contract initState $ \ state outTxId ->
333+ assertContractWithTxId contract initState $ \ state outTxId -> do
334334 assertCommandHistory
335335 state
336336 [
@@ -347,6 +347,7 @@ withoutSigning = do
347347 |]
348348 )
349349 ]
350+ assertCommandNotCalled state " cardano-cli transaction sign"
350351
351352sendTokens :: Assertion
352353sendTokens = do
@@ -852,3 +853,15 @@ assertCommandHistory state =
852853 ( \ (idx, expectedCmd) ->
853854 (state ^? commandHistory . ix idx) @?= Just (Text. replace " \n " " " expectedCmd)
854855 )
856+
857+ assertCommandCalled :: forall (w :: Type ). MockContractState w -> Text -> Assertion
858+ assertCommandCalled state expectedCmd =
859+ assertBool
860+ (Text. unpack . Text. unlines $ [" Command was not called:" , expectedCmd])
861+ (any (Text. isInfixOf (Text. replace " \n " " " expectedCmd)) (state ^. commandHistory))
862+
863+ assertCommandNotCalled :: forall (w :: Type ). MockContractState w -> Text -> Assertion
864+ assertCommandNotCalled state expectedCmd =
865+ assertBool
866+ (Text. unpack . Text. unlines $ [" Command was called:" , expectedCmd])
867+ (not (any (Text. isInfixOf (Text. replace " \n " " " expectedCmd)) (state ^. commandHistory)))
You can’t perform that action at this time.
0 commit comments