This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ Add tests for get node status command
- Loading branch information
Showing
10 changed files
with
185 additions
and
17 deletions.
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
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,95 @@ | ||
/* | ||
* LiskHQ/lisk-commander | ||
* Copyright © 2017–2018 Lisk Foundation | ||
* | ||
* See the LICENSE file at the top-level directory of this distribution | ||
* for licensing information. | ||
* | ||
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation, | ||
* no part of this software, including this file, may be copied, modified, | ||
* propagated, or distributed except according to the terms contained in the | ||
* LICENSE file. | ||
* | ||
* Removal or modification of this copyright notice is prohibited. | ||
* | ||
*/ | ||
import { setUpCommandGetNodeStatus } from '../../steps/setup'; | ||
import * as given from '../../steps/1_given'; | ||
import * as when from '../../steps/2_when'; | ||
import * as then from '../../steps/3_then'; | ||
|
||
describe('get node status command', () => { | ||
beforeEach(setUpCommandGetNodeStatus); | ||
Given('an action "get node status"', given.anAction, () => { | ||
Given('a Lisk API Instance', given.aLiskAPIInstance, () => { | ||
Given('an options object', given.anOptionsObject, () => { | ||
When( | ||
'the action is called with the options', | ||
when.theActionIsCalledWithTheOptions, | ||
() => { | ||
Then( | ||
'it should call node getConstants', | ||
then.itShouldCallNodeGetConstants, | ||
); | ||
Then( | ||
'it should call node getStatus', | ||
then.itShouldCallNodeGetStatus, | ||
); | ||
Then( | ||
'it should not call node getForgingStatus', | ||
then.itShouldNotCallNodeGetForgingStatus, | ||
); | ||
}, | ||
); | ||
Given('a boolean option "forging"', given.aBooleanOption, () => { | ||
Given( | ||
'a Lisk API Instance getForgingStatus rejects with error', | ||
given.aLiskAPIInstanceGetForgingStatusRejectsWithError, | ||
() => { | ||
When( | ||
'the action is called with the options', | ||
when.theActionIsCalledWithTheOptions, | ||
() => { | ||
Then( | ||
'it should call node getConstants', | ||
then.itShouldCallNodeGetConstants, | ||
); | ||
Then( | ||
'it should call node getStatus', | ||
then.itShouldCallNodeGetStatus, | ||
); | ||
Then( | ||
'it should call node getForgingStatus', | ||
then.itShouldCallNodeGetForgingStatus, | ||
); | ||
Then( | ||
'it should call node getForgingStatus', | ||
then.itShoulHaveErrorMessageForForgingStatus, | ||
); | ||
}, | ||
); | ||
}, | ||
); | ||
When( | ||
'the action is called with the options', | ||
when.theActionIsCalledWithTheOptions, | ||
() => { | ||
Then( | ||
'it should call node getConstants', | ||
then.itShouldCallNodeGetConstants, | ||
); | ||
Then( | ||
'it should call node getStatus', | ||
then.itShouldCallNodeGetStatus, | ||
); | ||
Then( | ||
'it should call node getForgingStatus', | ||
then.itShouldCallNodeGetForgingStatus, | ||
); | ||
}, | ||
); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
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
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
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
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
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
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
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
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