Compare commits

..

No commits in common. "06c534cbb1c2b513a1ac6f1485c57f87ff3b1918" and "71c01e00cd6a4468831d05dd0b61bd236882b4c2" have entirely different histories.

View File

@ -2124,19 +2124,20 @@ func TestCheckVouchers(t *testing.T) {
func TestGetVoucherList(t *testing.T) {
sessionId := "session123"
ctx, store := InitializeTestStore(t)
ctx = context.WithValue(ctx, "SessionId", sessionId)
ctx := context.WithValue(context.Background(), "SessionId", sessionId)
spdb := InitializeTestSubPrefixDb(t, ctx)
// Initialize MenuHandlers
h := &MenuHandlers{
userdataStore: store,
prefixDb: spdb,
ReplaceSeparatorFunc: mockReplaceSeparator,
}
mockSyms := []byte("1:SRF\n2:MILO")
// Put voucher sym data from the store
err := store.WriteEntry(ctx, sessionId, storedb.DATA_VOUCHER_SYMBOLS, mockSyms)
err := spdb.Put(ctx, storedb.ToBytes(storedb.DATA_VOUCHER_SYMBOLS), mockSyms)
if err != nil {
t.Fatal(err)
}
@ -2156,11 +2157,15 @@ func TestViewVoucher(t *testing.T) {
}
ctx, store := InitializeTestStore(t)
sessionId := "session123"
ctx = context.WithValue(ctx, "SessionId", sessionId)
spdb := InitializeTestSubPrefixDb(t, ctx)
h := &MenuHandlers{
userdataStore: store,
flagManager: fm,
prefixDb: spdb,
}
// Define mock voucher data
@ -2173,7 +2178,7 @@ func TestViewVoucher(t *testing.T) {
// Put the data
for key, value := range mockData {
err := store.WriteEntry(ctx, sessionId, key, []byte(value))
err = spdb.Put(ctx, []byte(storedb.ToBytes(key)), []byte(value))
if err != nil {
t.Fatal(err)
}