Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add integration test for GET /blocks/latest/header end-point
- Loading branch information
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
lib/core-integration/src/Test/Integration/Scenario/API/Blocks.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE ScopedTypeVariables #-} | ||
{-# LANGUAGE TypeApplications #-} | ||
|
||
module Test.Integration.Scenario.API.Blocks | ||
( spec | ||
) where | ||
|
||
import Prelude | ||
|
||
import Cardano.Wallet.Api.Types.BlockHeader | ||
( ApiBlockHeader ) | ||
import Test.Hspec | ||
( SpecWith, describe ) | ||
import Test.Hspec.Extra | ||
( it ) | ||
import Test.Integration.Framework.DSL | ||
( Context (..), Headers (..), Payload (..), expectResponseCode, request ) | ||
|
||
import qualified Cardano.Wallet.Api.Link as Link | ||
import qualified Network.HTTP.Types.Status as HTTP | ||
|
||
spec :: SpecWith Context | ||
spec = describe "BLOCKS" $ do | ||
it "LATEST_BLOCK Current tip is reported" $ \ctx -> do | ||
r <- request @ApiBlockHeader ctx Link.getBlocksLatestHeader Default Empty | ||
print r | ||
expectResponseCode @IO HTTP.status200 r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters