tested and functional in memory db

This commit is contained in:
2024-08-23 11:02:04 -05:00
parent dbc8ca3d29
commit 19c922a00e

View File

@@ -56,8 +56,32 @@ func TestApi(t *testing.T) {
Username: username,
}
keypadSize = model.KeypadSize{NumbOfKeys: 5, AttrsPerKey: 10}
var loginInterfaceResp model.GetLoginInterfaceResp
testApiCall(t, base+api.GetLoginInterface, loginInterfaceBody, &loginInterfaceResp)
keypadSize = model.KeypadSize{NumbOfKeys: 5, AttrsPerKey: 10}
loginKeySelection, err := nkode.SelectKeyByAttrIdx(loginInterfaceResp.UserInterface, userPasscode, keypadSize)
assert.NoError(t, err)
loginBody := model.LoginPost{
CustomerId: customerResp.CustomerId,
Username: username,
KeySelection: loginKeySelection,
}
testApiCall(t, base+api.Login, loginBody, nil)
renewBody := model.RenewAttributesPost{CustomerId: customerResp.CustomerId}
testApiCall(t, base+api.RenewAttributes, renewBody, nil)
loginKeySelection, err = nkode.SelectKeyByAttrIdx(loginInterfaceResp.UserInterface, userPasscode, keypadSize)
assert.NoError(t, err)
loginBody = model.LoginPost{
CustomerId: customerResp.CustomerId,
Username: username,
KeySelection: loginKeySelection,
}
testApiCall(t, base+api.Login, loginBody, nil)
}
func Unmarshal(t *testing.T, resp *http.Response, data any) {