From 9234bfd57982740fd39e1f4071ffdb13754e743a Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Mon, 30 Jun 2025 13:36:07 +0300 Subject: [PATCH] update the TestGetVoucherList to the expected content --- handlers/application/menuhandler_test.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/handlers/application/menuhandler_test.go b/handlers/application/menuhandler_test.go index f7a23ba..48ee27b 100644 --- a/handlers/application/menuhandler_test.go +++ b/handlers/application/menuhandler_test.go @@ -2208,20 +2208,25 @@ func TestGetVoucherList(t *testing.T) { ReplaceSeparatorFunc: mockReplaceSeparator, } - mockSyms := []byte("1:SRF\n2:MILO") + mockSymbols := []byte("1:SRF\n2:MILO") + mockBalances := []byte("1:10.099999\n2:40.7") - // Put voucher sym data from the store - err := store.WriteEntry(ctx, sessionId, storedb.DATA_VOUCHER_SYMBOLS, mockSyms) + // Put voucher symnols and balances data to the store + err := store.WriteEntry(ctx, sessionId, storedb.DATA_VOUCHER_SYMBOLS, mockSymbols) + if err != nil { + t.Fatal(err) + } + err = store.WriteEntry(ctx, sessionId, storedb.DATA_VOUCHER_BALANCES, mockBalances) if err != nil { t.Fatal(err) } - expectedSyms := []byte("1: SRF\n2: MILO") + expectedList := []byte("1: SRF 10.09\n2: MILO 40.70") res, err := h.GetVoucherList(ctx, "", []byte("")) assert.NoError(t, err) - assert.Equal(t, res.Content, string(expectedSyms)) + assert.Equal(t, res.Content, string(expectedList)) } func TestViewVoucher(t *testing.T) {