Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/utils/olm-utils.test.js
// @flow | // @flow | ||||
import olm from '@commapp/olm'; | import olm from '@commapp/olm'; | ||||
import { getOlmUtility } from '../utils/olm-utils.js'; | import { getOlmUtility } from '../utils/olm-utils.js'; | ||||
describe('olm.Account', () => { | describe('olm.Account', () => { | ||||
it('should get Olm Utility', async () => { | it('should get Olm Utility', async () => { | ||||
await olm.init(); | await olm.init(); | ||||
const utility = getOlmUtility(); | const utility = getOlmUtility(); | ||||
expect(utility).not.toBe(undefined); | expect(utility).not.toBe(undefined); | ||||
}); | }); | ||||
it('should be able to generate and return prekey', async () => { | |||||
await olm.init(); | |||||
const account = new olm.Account(); | |||||
account.create(); | |||||
account.generate_prekey(); | |||||
expect(account.prekey()).not.toBe(undefined); | |||||
}); | |||||
}); | }); |