forked from grassrootseconomics/visedriver
		
	update tests
This commit is contained in:
		
							parent
							
								
									4aad23ab30
								
							
						
					
					
						commit
						170d075545
					
				@ -13,12 +13,13 @@ import (
 | 
			
		||||
	"git.grassecon.net/urdt/ussd/internal/handlers"
 | 
			
		||||
	"git.grassecon.net/urdt/ussd/internal/storage"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	logg      = logging.NewVanilla()
 | 
			
		||||
	scriptDir = path.Join("services", "registration")
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func TestEngine(sessionId string) (engine.Engine,*persist.Persister){
 | 
			
		||||
func TestEngine(sessionId string) (engine.Engine, *persist.Persister) {
 | 
			
		||||
	ctx := context.Background()
 | 
			
		||||
	ctx = context.WithValue(ctx, "SessionId", sessionId)
 | 
			
		||||
	pfp := path.Join(scriptDir, "pp.csv")
 | 
			
		||||
@ -83,6 +84,6 @@ func TestEngine(sessionId string) (engine.Engine,*persist.Persister){
 | 
			
		||||
	en = en.WithFirst(hl.Init)
 | 
			
		||||
 | 
			
		||||
	//en = en.WithDebug(nil)
 | 
			
		||||
	return en,pe
 | 
			
		||||
	return en, pe
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -6,7 +6,7 @@ import (
 | 
			
		||||
	"testing"
 | 
			
		||||
 | 
			
		||||
	"git.grassecon.net/urdt/ussd/driver"
 | 
			
		||||
	"git.grassecon.net/urdt/ussd/enginetest"
 | 
			
		||||
	"git.grassecon.net/urdt/ussd/engine"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
 | 
			
		||||
@ -1,19 +1,50 @@
 | 
			
		||||
{
 | 
			
		||||
    "user_registration": [
 | 
			
		||||
        {
 | 
			
		||||
            "input": ["","0", "0","1234","1234"],
 | 
			
		||||
            "expected": "Registration successful"
 | 
			
		||||
            
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "pincheck": [
 | 
			
		||||
        {
 | 
			
		||||
            "input": ["1234"],
 | 
			
		||||
            "expected": "PIN valid"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "input": ["5678"],
 | 
			
		||||
            "expected": "PIN invalid"
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
}
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "name": "session one",
 | 
			
		||||
        "groups": [
 | 
			
		||||
            {
 | 
			
		||||
                "name": "account_creation_successful",
 | 
			
		||||
                "steps": [
 | 
			
		||||
                    {
 | 
			
		||||
                        "input": "",
 | 
			
		||||
                       "expectedContent": "Welcome to Sarafu Network\nPlease select a language\n0:english\n1:kiswahili"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "input": "0",
 | 
			
		||||
                       "expectedContent": "Do you agree to terms and conditions?\n0:yes\n1:no"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "input": "0",
 | 
			
		||||
                       "expectedContent": "Please enter a new four number PIN for your account:\n0:Exit"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "input": "1234",
 | 
			
		||||
                       "expectedContent": "Enter your four number PIN again:"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "input": "1234",
 | 
			
		||||
                       "expectedContent": "Enter your four number PIN again:"
 | 
			
		||||
                    }
 | 
			
		||||
                ]
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                "name": "account_creation_accept_terms",
 | 
			
		||||
                "steps": [
 | 
			
		||||
                    {
 | 
			
		||||
                        "input": "",
 | 
			
		||||
                       "expectedContent": "Welcome to Sarafu Network\nPlease select a language\n0:english\n1:kiswahili"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "input": "0",
 | 
			
		||||
                       "expectedContent": "Do you agree to terms and conditions?\n0:yes\n1:no"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "input": "0",
 | 
			
		||||
                       "expectedContent": "Please enter a new four number PIN for your account:\n0:Exit"
 | 
			
		||||
                    }
 | 
			
		||||
                   
 | 
			
		||||
                ]
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    }
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user