Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce number of tests that create new did:dht DIDs #860

Merged
merged 2 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions packages/agent/tests/cached-permissions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ import { PlatformAgentTestHarness } from '../src/test-harness.js';
import { TestAgent } from './utils/test-agent.js';
import { BearerDid } from '@web5/dids';

import { testDwnUrl } from './utils/test-config.js';
import { DwnInterfaceName, DwnMethodName, Time } from '@tbd54566975/dwn-sdk-js';
import { CachedPermissions, DwnInterface } from '../src/index.js';
import { Convert } from '@web5/common';

let testDwnUrls: string[] = [testDwnUrl];

describe('CachedPermissions', () => {
let permissions: AgentPermissionsApi;
let testHarness: PlatformAgentTestHarness;
Expand All @@ -37,11 +34,11 @@ describe('CachedPermissions', () => {
await testHarness.createAgentDid();

// Create an "alice" Identity to author the DWN messages.
const alice = await testHarness.createIdentity({ name: 'Alice', testDwnUrls });
const alice = await testHarness.agent.identity.create({ didMethod: 'jwk', metadata: { name: 'Alice' } });
await testHarness.agent.identity.manage({ portableIdentity: await alice.export() });
aliceDid = alice.did;

const bob = await testHarness.createIdentity({ name: 'Bob', testDwnUrls });
const bob = await testHarness.agent.identity.create({ didMethod: 'jwk', metadata: { name: 'Bob' } });
await testHarness.agent.identity.manage({ portableIdentity: await bob.export() });
bobDid = bob.did;

Expand Down
4 changes: 1 addition & 3 deletions packages/agent/tests/permissions-api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import { PlatformAgentTestHarness } from '../src/test-harness.js';
import { TestAgent } from './utils/test-agent.js';
import { BearerDid } from '@web5/dids';

import { testDwnUrl } from './utils/test-config.js';
import { DwnInterfaceName, DwnMethodName, Time } from '@tbd54566975/dwn-sdk-js';
import { DwnInterface, DwnPermissionGrant, DwnPermissionScope, Web5PlatformAgent } from '../src/index.js';

let testDwnUrls: string[] = [testDwnUrl];

describe('AgentPermissionsApi', () => {
let testHarness: PlatformAgentTestHarness;
Expand All @@ -34,7 +32,7 @@ describe('AgentPermissionsApi', () => {
await testHarness.createAgentDid();

// Create an "alice" Identity to author the DWN messages.
const alice = await testHarness.createIdentity({ name: 'Alice', testDwnUrls });
const alice = await testHarness.agent.identity.create({ didMethod: 'jwk', metadata: { name: 'Alice' } });
await testHarness.agent.identity.manage({ portableIdentity: await alice.export() });
aliceDid = alice.did;
});
Expand Down
Loading
Loading