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") en, fn := enginetest.TestEngine("session1234112")
defer fn() defer fn()
ctx := context.Background() ctx := context.Background()
sessions := testData sessions := testData
for _, session := range sessions { 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 _, group := range groups {
for _, step := range group.Steps { for _, step := range group.Steps {
cont, err := en.Exec(ctx, []byte(step.Input)) 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": [ "steps": [
{ {
"input": "", "input": "",
@ -119,10 +119,26 @@
"input": "065656", "input": "065656",
"expectedContent": "Maximum amount: 0.003 CELO\nEnter amount:\n0:Back" "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", "input": "0.001",
"expectedContent": "065656 will receive 0.001 from 0xd6CF3C87b0D4aD5978448bBbD6Db9EC6D74D624b\nPlease enter your PIN to confirm:\n0:Back\n9:Quit" "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", "input": "1234",
"expectedContent": "Your request has been sent. 065656 will receive 0.001 from 0xd6CF3C87b0D4aD5978448bBbD6Db9EC6D74D624b." "expectedContent": "Your request has been sent. 065656 will receive 0.001 from 0xd6CF3C87b0D4aD5978448bBbD6Db9EC6D74D624b."