mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 22:49:28 -07:00
Fix keys tests
This commit is contained in:
parent
33f4b5c882
commit
b70065b15c
1 changed files with 9 additions and 8 deletions
|
@ -106,7 +106,7 @@ describe('keys.process', () => {
|
||||||
it('should return an object with specific keys', async () => {
|
it('should return an object with specific keys', async () => {
|
||||||
const pubKey = await doipjs.keys.fetch.plaintext(pubKeyPlaintext)
|
const pubKey = await doipjs.keys.fetch.plaintext(pubKeyPlaintext)
|
||||||
const obj = await doipjs.keys.process(pubKey)
|
const obj = await doipjs.keys.process(pubKey)
|
||||||
expect(obj).to.have.keys(['user', 'fingerprint'])
|
expect(obj).to.have.keys(['users', 'fingerprint', 'primaryUserIndex'])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -122,15 +122,16 @@ describe('keys.getFingerprint', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('keys.getClaims', () => {
|
describe('keys.getUserData', () => {
|
||||||
it('should be a function (1 argument)', () => {
|
it('should be a function (1 argument)', () => {
|
||||||
expect(doipjs.keys.getClaims).to.be.a('function')
|
expect(doipjs.keys.getUserData).to.be.a('function')
|
||||||
expect(doipjs.keys.getClaims).to.have.length(1)
|
expect(doipjs.keys.getUserData).to.have.length(1)
|
||||||
})
|
})
|
||||||
it('should return an array of strings', async () => {
|
it('should return an array of userData objects', async () => {
|
||||||
const pubKey = await doipjs.keys.fetch.plaintext(pubKeyPlaintext)
|
const pubKey = await doipjs.keys.fetch.plaintext(pubKeyPlaintext)
|
||||||
const arr = await doipjs.keys.getClaims(pubKey)
|
const userData = await doipjs.keys.getUserData(pubKey)
|
||||||
expect(arr).to.be.lengthOf(1)
|
expect(userData).to.be.lengthOf(1)
|
||||||
expect(arr[0]).to.be.equal('dns:doip.rocks')
|
expect(userData[0].userData.email).to.be.equal(pubKeyEmail)
|
||||||
|
expect(userData[0].notations[0]).to.be.equal('dns:doip.rocks')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue