aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-01-30 23:09:52 +0100
committerFlorian Dold <florian@dold.me>2024-01-30 23:10:01 +0100
commitf14c643f4a66fc56199eb4aba66a7d5429911db7 (patch)
tree2410fe2516d51a9fd1b48b38bd10e803cee63b8b /packages/taler-harness
parentc5f97c8f493b52f9e083548d0ac71592c56a2b79 (diff)
harness,util,others: complete otp integration test, move rfc3548 to taler-utilv0.9.4-dev.10
Diffstat (limited to 'packages/taler-harness')
-rw-r--r--packages/taler-harness/src/integrationtests/test-otp.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-otp.ts b/packages/taler-harness/src/integrationtests/test-otp.ts
index d4dee12ad..3636b1f47 100644
--- a/packages/taler-harness/src/integrationtests/test-otp.ts
+++ b/packages/taler-harness/src/integrationtests/test-otp.ts
@@ -22,10 +22,10 @@ import {
Duration,
MerchantApiClient,
PreparePayResultType,
- encodeCrock,
- getRandomBytes,
+ TransactionType,
j2s,
narrowOpSuccessOrThrow,
+ randomRfc3548Base32Key,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { GlobalTestState } from "../harness/harness.js";
@@ -48,7 +48,7 @@ export async function runOtpTest(t: GlobalTestState) {
otp_algorithm: 1,
otp_device_description: "Hello",
otp_device_id: "mydevice",
- otp_key: encodeCrock(getRandomBytes(16)),
+ otp_key: randomRfc3548Base32Key(),
});
narrowOpSuccessOrThrow(createOtpRes);
@@ -109,6 +109,10 @@ export async function runOtpTest(t: GlobalTestState) {
);
console.log(j2s(transaction));
+
+ t.assertTrue(transaction.type === TransactionType.Payment);
+ t.assertTrue(transaction.posConfirmation != null);
+ t.assertTrue(transaction.posConfirmation.length > 10);
}
runOtpTest.suites = ["wallet"];