Skip to content

Commit

Permalink
highlight reported failure in integration scenarios by adding more as…
Browse files Browse the repository at this point in the history
…sertions
  • Loading branch information
KtorZ committed Aug 7, 2020
1 parent 4a4d0a6 commit 5757a55
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1301,13 +1301,20 @@ spec = do
}],
"passphrase": #{fixturePassphrase}
}|]
let fee = 143600

rTx <- request @(ApiTransaction n) ctx
(Link.createTransaction @'Shelley wSelf) Default payload
verify rTx
[ expectResponseCode HTTP.status202
, expectField #withdrawals
(`shouldSatisfy` (not . null))
, expectField (#direction . #getApiT)
(`shouldBe` Incoming)
, expectField (#amount . #getQuantity)
(`shouldBe` (oneMillionAda - fee))
]
let tid = getFromResponse Prelude.id rTx

eventually "rewards disappear from other" $ do
rWOther <- request @ApiWallet ctx
Expand All @@ -1317,6 +1324,20 @@ spec = do
(`shouldBe` Quantity 0)
]

eventually "withdrawal transaction is listed on other" $ do
rTxOther <- request @(ApiTransaction n) ctx
(Link.getTransaction @'Shelley wOther tid) Default payload
verify rTxOther
[ expectResponseCode
HTTP.status200
, expectField #withdrawals
(`shouldSatisfy` (not . null))
, expectField (#direction . #getApiT)
(`shouldBe` Outgoing)
, expectField (#amount . #getQuantity)
(`shouldBe` oneMillionAda)
]

eventually "rewards appear on self" $ do
rWSelf <- request @ApiWallet ctx
(Link.getWallet @'Shelley wSelf) Default payload
Expand All @@ -1325,6 +1346,22 @@ spec = do
(.> (wSelf ^. #balance . #getApiT . #available))
]

eventually "withdrawal transaction is listed on self" $ do
rTxSelf <- request @(ApiTransaction n) ctx
(Link.getTransaction @'Shelley wSelf tid) Default payload
verify rTxSelf
[ expectResponseCode
HTTP.status200
, expectField #withdrawals
(`shouldSatisfy` (not . null))
, expectField (#direction . #getApiT)
(`shouldBe` Incoming)
, expectField (#amount . #getQuantity)
(`shouldBe` (oneMillionAda - fee))
, expectField (#status . #getApiT)
(`shouldBe` InLedger)
]

it "SHELLEY_TX_REDEEM_03 - Can't redeem rewards from other if none left" $ \ctx -> do
(wOther, mw) <- rewardWallet ctx
wSelf <- fixtureWallet ctx
Expand Down

0 comments on commit 5757a55

Please sign in to comment.