}
/**
- * Gets all names associated with a name from the rolodex.
+ * Gets all Nano addresses associated with a name from the rolodex.
*
* @param {string} name - Alias to look up
* @returns {string[]} List of Nano addresses associated with the name
import { NANO_TEST_VECTORS } from './TEST_VECTORS.js'
describe('rolodex valid contact management', async () => {
- it('should create a rolodex and add a contact', async () => {
+ it('should create a rolodex and add two contacts', async () => {
const rolodex = new Rolodex()
assert.equal(rolodex.constructor, Rolodex)
await rolodex.add('JohnDoe', NANO_TEST_VECTORS.ADDRESS_0)
+ await rolodex.add('JaneSmith', NANO_TEST_VECTORS.ADDRESS_1)
+
+ assert.equal(rolodex.getAllNames().length, 2)
+ assert.equal(rolodex.getAllNames()[0], 'JohnDoe')
+ assert.equal(rolodex.getAllNames()[1], 'JaneSmith')
assert.equal(rolodex.getAddresses('JohnDoe').length, 1)
assert.equal(rolodex.getAddresses('JohnDoe')[0], NANO_TEST_VECTORS.ADDRESS_0)
+ assert.equal(rolodex.getAddresses('JaneSmith').length, 1)
+ assert.equal(rolodex.getAddresses('JaneSmith')[0], NANO_TEST_VECTORS.ADDRESS_1)
})
it('should get a name from an address', async () => {