Skip to content

Commit

Permalink
test: identity attribute succession
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Gann committed Dec 5, 2023
1 parent 149decf commit af22a47
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions test/attributes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import { ValidationSchema } from "./lib/validation";

const launcher = new Launcher();
let client1: ConnectorClient;
let client1Address: string;

beforeAll(async () => {
[client1] = await launcher.launch(1);
client1Address = (await client1.account.getIdentityInfo()).result.address;
}, 30000);
afterAll(() => launcher.stop());

Expand Down Expand Up @@ -152,4 +150,31 @@ describe("Execute AttributeQueries", () => {

// expect(executeRelationshipAttributeQueryResult.result.content.value.value).toBe("AString");
// });

describe("Succeed Attribute", () => {
test("Should succeed an Identity Attribute", async () => {
const createAttributeResponse = await client1.attributes.createIdentityAttribute({
value: {
"@type": "GivenName",
value: "AGivenName"
},
tags: ["content:edu.de"]
});

const attributeId = createAttributeResponse.result.id;

const succeedAttributeResponse = await client1.attributes.succeedIdentityAttribute({
predecessorId: attributeId,
successorContent: {
value: {
"@type": "GivenName",
value: "AGivenName"
},
tags: ["content:edu.de"]
}
});

expect(succeedAttributeResponse.isSuccess).toBe(true);
});
});
});

0 comments on commit af22a47

Please sign in to comment.