Skip to content

Commit

Permalink
Merge branch 'dev' into p-104-add-a-smoke-test-during-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jonalvarezz authored Jul 23, 2024
2 parents e4cf96f + 761639b commit 3faec08
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tee-worker/ts-tests/integration-tests/dr_vc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import type { CorePrimitivesIdentity, WorkerRpcReturnValue } from 'parachain-api
import { mockBatchAssertion } from './common/utils/vc-helper';
import type { LitentryValidationData, Web3Network } from 'parachain-api';
import type { Vec, Bytes } from '@polkadot/types';
import { subscribeToEventsWithExtHash } from './common/transactions';
import { assert } from 'chai';

describe('Test Vc (direct request)', function () {
let context: IntegrationTestContext = undefined as any;
Expand Down Expand Up @@ -171,6 +173,7 @@ describe('Test Vc (direct request)', function () {
if (vcresponse.result.isOk) await assertVc(context, aliceSubstrateIdentity, vcresponse.result.asOk);
};

const eventsPromise = subscribeToEventsWithExtHash(requestIdentifier, context);
// the +res+ below is the last message with "do_watch: false" property and we may not need it at all
const res = await sendRequestFromTrustedCall(
context,
Expand All @@ -180,6 +183,9 @@ describe('Test Vc (direct request)', function () {
onMessageReceived
);

const events = (await eventsPromise).map(({ event }) => event);
assert.equal(events.length, Array.isArray(assertion) ? assertion.length : 1);

// @todo: assert batch vc response
});
});
Expand Down

0 comments on commit 3faec08

Please sign in to comment.