mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2025-02-24 08:29:54 -05:00
reject payment accounts with duplicate names
This commit is contained in:
parent
df701601b0
commit
3e637aa8c1
@ -1098,16 +1098,19 @@ test("Can create crypto payment accounts (CI)", async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// test invalid currency code
|
// test invalid currency code
|
||||||
await expect(async () => { await user1.createCryptoPaymentAccount("My account", "ABC", "123"); })
|
await expect(async () => { await user1.createCryptoPaymentAccount("My first account", "ABC", "123"); })
|
||||||
.rejects
|
.rejects
|
||||||
.toThrow("crypto currency with code 'abc' not found");
|
.toThrow("crypto currency with code 'abc' not found");
|
||||||
|
|
||||||
// test invalid address
|
// test invalid address
|
||||||
await expect(async () => { await user1.createCryptoPaymentAccount("My account", "ETH", "123"); })
|
await expect(async () => { await user1.createCryptoPaymentAccount("My second account", "ETH", "123"); })
|
||||||
.rejects
|
.rejects
|
||||||
.toThrow('123 is not a valid eth address');
|
.toThrow('123 is not a valid eth address');
|
||||||
|
|
||||||
// TODO (woodser): test rejecting account with duplicate name
|
// test address duplicity
|
||||||
|
await expect(async () => { await user1.createCryptoPaymentAccount("My second account", "ABC", "666"); })
|
||||||
|
.rejects
|
||||||
|
.toThrow("Account 'My second account' is already taken");
|
||||||
|
|
||||||
function testCryptoPaymentAccountEquals(paymentAccount: PaymentAccount, testAccount: any, name: string) {
|
function testCryptoPaymentAccountEquals(paymentAccount: PaymentAccount, testAccount: any, name: string) {
|
||||||
expect(paymentAccount.getAccountName()).toEqual(name);
|
expect(paymentAccount.getAccountName()).toEqual(name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user