Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1699 from talwinder50/issue-bugfix
Browse files Browse the repository at this point in the history
fix: Sign Verifiable Presentation bdd test bug
  • Loading branch information
troyronda authored May 6, 2020
2 parents a79d399 + 03f598d commit 7c5fafc
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions test/aries-js-worker/test/verifiable/verifiable.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ describe("Verifiable Store Test", function () {

async function verifiableStore(newAries, mode = wasmMode) {
let aries
let did
let retries = 10;
let modePrefix = '[' + mode + '] '

before(async () => {
Expand Down Expand Up @@ -134,7 +136,6 @@ async function verifiableStore(newAries, mode = wasmMode) {
)
})

var did
it(modePrefix + "create public DID using VDRI in WASM and REST Client mode", function (done) {
aries.vdri.createPublicDID({
method: "sidetree",
Expand All @@ -148,6 +149,16 @@ async function verifiableStore(newAries, mode = wasmMode) {
)
})

it(modePrefix + "Alice makes sure that the DID is resolvable", async function () {
for (let i = 0; i < retries; i++) {
try {
return await aries.vdri.resolveDID({id:getID(mode, did.id)})
}catch (e) {}

await new Promise(r => setTimeout(r, 1000));
}
})

it(modePrefix + "Alice stores the did generated by her", function (done) {
aries.vdri.saveDID({
name: mode + "_" + didName,
Expand All @@ -162,7 +173,6 @@ async function verifiableStore(newAries, mode = wasmMode) {

// TODO enable this test after updating sidetree-mock
// it(modePrefix + "Alice generates the signed verifiable presentation from the previously saved verifiable credential", async function () {
// await healthCheck(`${environment.HTTP_LOCAL_RESOLVER_URL}/` + did.id, 5000, "resolve did timeout!")
// await aries.verifiable.generatePresentationByID({
// "id": getCredentialID(mode, vcID),
// "did": did.id,
Expand All @@ -182,7 +192,6 @@ async function verifiableStore(newAries, mode = wasmMode) {

// TODO below test to be enabled once creating sidetree DID with authentication method is available in aries vdri [Issue #1747]
xit(modePrefix + "Alice generates the signed verifiable presentation to pass it to the employer", async function () {
await healthCheck(`${environment.HTTP_LOCAL_RESOLVER_URL}/` + did.id, 5000, "resolve did timeout!")
await aries.verifiable.generatePresentation({
"verifiableCredential": [JSON.parse(vc)],
"did": did.id,
Expand Down

0 comments on commit 7c5fafc

Please sign in to comment.