test with all invalid inputs

This commit is contained in:
Alfred Kamanda 2024-10-01 13:26:47 +03:00
parent 285002738f
commit 3e74c1d939
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703
2 changed files with 19 additions and 3 deletions

View File

@ -138,13 +138,13 @@ func TestAccountRegistrationInvalidPin(t *testing.T) {
}
}
func TestSendWithInvalidRecipient(t *testing.T) {
func TestSendWithInvalidInputs(t *testing.T) {
en, fn := enginetest.TestEngine("session1234112")
defer fn()
ctx := context.Background()
sessions := testData
for _, session := range sessions {
groups := driver.FilterGroupsByName(session.Groups, "send_with_invalid_recipient")
groups := driver.FilterGroupsByName(session.Groups, "send_with_invalid_inputs")
for _, group := range groups {
for _, step := range group.Steps {
cont, err := en.Exec(ctx, []byte(step.Input))

View File

@ -97,7 +97,7 @@
]
},
{
"name": "send_with_invalid_recipient",
"name": "send_with_invalid_inputs",
"steps": [
{
"input": "",
@ -119,10 +119,26 @@
"input": "065656",
"expectedContent": "Maximum amount: 0.003 CELO\nEnter amount:\n0:Back"
},
{
"input": "0.1",
"expectedContent": "Amount 0.1 is invalid, please try again:\n1:retry\n9:Quit"
},
{
"input": "1",
"expectedContent": "Maximum amount: 0.003 CELO\nEnter amount:\n0:Back"
},
{
"input": "0.001",
"expectedContent": "065656 will receive 0.001 from 0xd6CF3C87b0D4aD5978448bBbD6Db9EC6D74D624b\nPlease enter your PIN to confirm:\n0:Back\n9:Quit"
},
{
"input": "1222",
"expectedContent": "Incorrect pin\n1:retry\n9:Quit"
},
{
"input": "1",
"expectedContent": "065656 will receive 0.001 from 0xd6CF3C87b0D4aD5978448bBbD6Db9EC6D74D624b\nPlease enter your PIN to confirm:\n0:Back\n9:Quit"
},
{
"input": "1234",
"expectedContent": "Your request has been sent. 065656 will receive 0.001 from 0xd6CF3C87b0D4aD5978448bBbD6Db9EC6D74D624b."