@renown/sdk 6.0.0-dev.69 → 6.0.0-dev.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/common.d.ts +5 -3
- package/dist/src/common.d.ts.map +1 -1
- package/dist/src/common.js +44 -12
- package/dist/src/common.js.map +1 -1
- package/dist/src/crypto/common.d.ts +6 -0
- package/dist/src/crypto/common.d.ts.map +1 -0
- package/dist/src/crypto/common.js +8 -0
- package/dist/src/crypto/common.js.map +1 -0
- package/dist/src/crypto/index.d.ts +1 -5
- package/dist/src/crypto/index.d.ts.map +1 -1
- package/dist/src/crypto/index.js +1 -7
- package/dist/src/crypto/index.js.map +1 -1
- package/dist/src/crypto/node.d.ts +1 -0
- package/dist/src/crypto/node.d.ts.map +1 -1
- package/dist/src/crypto/node.js +1 -1
- package/dist/src/crypto/node.js.map +1 -1
- package/dist/src/index.d.ts +1 -8
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -8
- package/dist/src/index.js.map +1 -1
- package/dist/src/node.d.ts +3 -3
- package/dist/src/node.d.ts.map +1 -1
- package/dist/src/node.js +3 -3
- package/dist/src/node.js.map +1 -1
- package/dist/src/profile.d.ts +3 -0
- package/dist/src/profile.d.ts.map +1 -0
- package/dist/src/profile.js +22 -0
- package/dist/src/profile.js.map +1 -0
- package/dist/src/renown-builder.d.ts +9 -1
- package/dist/src/renown-builder.d.ts.map +1 -1
- package/dist/src/renown-builder.js +16 -1
- package/dist/src/renown-builder.js.map +1 -1
- package/dist/src/types.d.ts +23 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +6 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +6 -0
- package/dist/src/utils.js.map +1 -1
- package/dist/test/renown.test.d.ts +2 -0
- package/dist/test/renown.test.d.ts.map +1 -0
- package/dist/test/renown.test.js +287 -0
- package/dist/test/renown.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -28
- package/dist/e2e/fixtures/main.d.ts +0 -2
- package/dist/e2e/fixtures/main.d.ts.map +0 -1
- package/dist/e2e/fixtures/main.js +0 -97
- package/dist/e2e/fixtures/main.js.map +0 -1
- package/dist/e2e/fixtures/vite.config.d.ts +0 -3
- package/dist/e2e/fixtures/vite.config.d.ts.map +0 -1
- package/dist/e2e/fixtures/vite.config.js +0 -10
- package/dist/e2e/fixtures/vite.config.js.map +0 -1
- package/dist/e2e/renown-components.spec.d.ts +0 -2
- package/dist/e2e/renown-components.spec.d.ts.map +0 -1
- package/dist/e2e/renown-components.spec.js +0 -155
- package/dist/e2e/renown-components.spec.js.map +0 -1
- package/dist/playwright.config.d.ts +0 -3
- package/dist/playwright.config.d.ts.map +0 -1
- package/dist/playwright.config.js +0 -25
- package/dist/playwright.config.js.map +0 -1
- package/dist/src/assets/assets.d.ts +0 -19
- package/dist/src/assets/renown-hover.svg +0 -17
- package/dist/src/assets/renown-light.svg +0 -15
- package/dist/src/assets/renown-short-hover.png +0 -0
- package/dist/src/assets/renown-short.png +0 -0
- package/dist/src/assets/renown.svg +0 -16
- package/dist/src/components/RenownAuthButton.d.ts +0 -62
- package/dist/src/components/RenownAuthButton.d.ts.map +0 -1
- package/dist/src/components/RenownAuthButton.js +0 -82
- package/dist/src/components/RenownAuthButton.js.map +0 -1
- package/dist/src/components/RenownLoginButton.d.ts +0 -48
- package/dist/src/components/RenownLoginButton.d.ts.map +0 -1
- package/dist/src/components/RenownLoginButton.js +0 -175
- package/dist/src/components/RenownLoginButton.js.map +0 -1
- package/dist/src/components/RenownUserButton.d.ts +0 -66
- package/dist/src/components/RenownUserButton.d.ts.map +0 -1
- package/dist/src/components/RenownUserButton.js +0 -216
- package/dist/src/components/RenownUserButton.js.map +0 -1
- package/dist/src/components/icons.d.ts +0 -25
- package/dist/src/components/icons.d.ts.map +0 -1
- package/dist/src/components/icons.js +0 -24
- package/dist/src/components/icons.js.map +0 -1
- package/dist/src/components/image-data.d.ts +0 -3
- package/dist/src/components/image-data.d.ts.map +0 -1
- package/dist/src/components/image-data.js +0 -4
- package/dist/src/components/image-data.js.map +0 -1
- package/dist/src/components/index.d.ts +0 -8
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/components/index.js +0 -5
- package/dist/src/components/index.js.map +0 -1
- package/dist/src/hooks/index.d.ts +0 -2
- package/dist/src/hooks/index.d.ts.map +0 -1
- package/dist/src/hooks/index.js +0 -2
- package/dist/src/hooks/index.js.map +0 -1
- package/dist/src/hooks/use-user.d.ts +0 -21
- package/dist/src/hooks/use-user.d.ts.map +0 -1
- package/dist/src/hooks/use-user.js +0 -30
- package/dist/src/hooks/use-user.js.map +0 -1
- package/dist/src/index.browser.d.ts +0 -4
- package/dist/src/index.browser.d.ts.map +0 -1
- package/dist/src/index.browser.js +0 -4
- package/dist/src/index.browser.js.map +0 -1
- package/dist/src/index.node.d.ts +0 -4
- package/dist/src/index.node.d.ts.map +0 -1
- package/dist/src/index.node.js +0 -4
- package/dist/src/index.node.js.map +0 -1
- package/dist/src/lib/renown/constants.d.ts +0 -130
- package/dist/src/lib/renown/constants.d.ts.map +0 -1
- package/dist/src/lib/renown/constants.js +0 -40
- package/dist/src/lib/renown/constants.js.map +0 -1
- package/dist/src/lib/renown/credential.d.ts +0 -2
- package/dist/src/lib/renown/credential.d.ts.map +0 -1
- package/dist/src/lib/renown/credential.js +0 -68
- package/dist/src/lib/renown/credential.js.map +0 -1
- package/dist/src/lib/renown/did-parser.d.ts +0 -28
- package/dist/src/lib/renown/did-parser.d.ts.map +0 -1
- package/dist/src/lib/renown/did-parser.js +0 -57
- package/dist/src/lib/renown/did-parser.js.map +0 -1
- package/dist/src/lib/renown/index.d.ts +0 -4
- package/dist/src/lib/renown/index.d.ts.map +0 -1
- package/dist/src/lib/renown/index.js +0 -4
- package/dist/src/lib/renown/index.js.map +0 -1
- package/dist/src/lib/renown/utils.d.ts +0 -33
- package/dist/src/lib/renown/utils.d.ts.map +0 -1
- package/dist/src/lib/renown/utils.js +0 -188
- package/dist/src/lib/renown/utils.js.map +0 -1
- package/dist/src/lib/session-storage.d.ts +0 -40
- package/dist/src/lib/session-storage.d.ts.map +0 -1
- package/dist/src/lib/session-storage.js +0 -107
- package/dist/src/lib/session-storage.js.map +0 -1
- package/dist/src/providers/index.d.ts +0 -3
- package/dist/src/providers/index.d.ts.map +0 -1
- package/dist/src/providers/index.js +0 -2
- package/dist/src/providers/index.js.map +0 -1
- package/dist/src/providers/renown-user-provider.d.ts +0 -76
- package/dist/src/providers/renown-user-provider.d.ts.map +0 -1
- package/dist/src/providers/renown-user-provider.js +0 -166
- package/dist/src/providers/renown-user-provider.js.map +0 -1
- package/dist/test/script.test.d.ts +0 -2
- package/dist/test/script.test.d.ts.map +0 -1
- package/dist/test/script.test.js +0 -144
- package/dist/test/script.test.js.map +0 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { Renown, RenownMemoryStorage } from "../src/common.js";
|
|
3
|
+
import { MemoryKeyStorage, RenownCryptoBuilder } from "../src/crypto/index.js";
|
|
4
|
+
import { MemoryEventEmitter } from "../src/event/memory.js";
|
|
5
|
+
import { fetchRenownProfile } from "../src/profile.js";
|
|
6
|
+
const TEST_BASE_URL = "https://test.renown.id";
|
|
7
|
+
const TEST_ADDRESS = "0x9aDdcBbaA28F7eB5f75E023F7C1Fcb13C9DFD8F7";
|
|
8
|
+
const TEST_USER_DID = `did:pkh:eip155:1:${TEST_ADDRESS}`;
|
|
9
|
+
function createMockCredential(userDid, appDid) {
|
|
10
|
+
return {
|
|
11
|
+
"@context": ["https://www.w3.org/2018/credentials/v1"],
|
|
12
|
+
id: "test-credential-id",
|
|
13
|
+
type: ["VerifiableCredential"],
|
|
14
|
+
issuer: {
|
|
15
|
+
id: userDid,
|
|
16
|
+
ethereumAddress: TEST_ADDRESS,
|
|
17
|
+
},
|
|
18
|
+
issuanceDate: new Date().toISOString(),
|
|
19
|
+
credentialSubject: {
|
|
20
|
+
id: appDid,
|
|
21
|
+
app: "test-app",
|
|
22
|
+
},
|
|
23
|
+
credentialSchema: {
|
|
24
|
+
id: "https://schema.org",
|
|
25
|
+
type: "JsonSchemaValidator2018",
|
|
26
|
+
},
|
|
27
|
+
proof: {
|
|
28
|
+
verificationMethod: "test",
|
|
29
|
+
ethereumAddress: TEST_ADDRESS,
|
|
30
|
+
created: new Date().toISOString(),
|
|
31
|
+
proofPurpose: "assertionMethod",
|
|
32
|
+
type: "EthereumEip712Signature2021",
|
|
33
|
+
proofValue: "0xtest",
|
|
34
|
+
eip712: {
|
|
35
|
+
domain: {
|
|
36
|
+
name: "Renown",
|
|
37
|
+
version: "1",
|
|
38
|
+
chainId: 1,
|
|
39
|
+
verifyingContract: "0x0000000000000000000000000000000000000000",
|
|
40
|
+
},
|
|
41
|
+
types: {},
|
|
42
|
+
primaryType: "VerifiableCredential",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const MOCK_PROFILE = {
|
|
48
|
+
documentId: "doc-123",
|
|
49
|
+
username: "testuser",
|
|
50
|
+
ethAddress: TEST_ADDRESS,
|
|
51
|
+
userImage: "https://example.com/avatar.png",
|
|
52
|
+
createdAt: "2025-01-01T00:00:00Z",
|
|
53
|
+
updatedAt: "2025-01-01T00:00:00Z",
|
|
54
|
+
};
|
|
55
|
+
describe("Renown login flow", () => {
|
|
56
|
+
let renown;
|
|
57
|
+
let appDid;
|
|
58
|
+
beforeEach(async () => {
|
|
59
|
+
const keyStorage = new MemoryKeyStorage();
|
|
60
|
+
const crypto = await new RenownCryptoBuilder()
|
|
61
|
+
.withKeyPairStorage(keyStorage)
|
|
62
|
+
.build();
|
|
63
|
+
appDid = crypto.did;
|
|
64
|
+
renown = new Renown(new RenownMemoryStorage(), new MemoryEventEmitter(), crypto, "test-app", TEST_BASE_URL, fetchRenownProfile);
|
|
65
|
+
});
|
|
66
|
+
afterEach(() => {
|
|
67
|
+
vi.restoreAllMocks();
|
|
68
|
+
});
|
|
69
|
+
function mockFetch(options) {
|
|
70
|
+
const { credential, profile = MOCK_PROFILE, credentialStatus = 200, profileStatus = 200, } = options;
|
|
71
|
+
vi.spyOn(globalThis, "fetch").mockImplementation(async (input) => {
|
|
72
|
+
const url = input instanceof URL ? input.toString() : String(input);
|
|
73
|
+
if (url.includes("/api/auth/credential")) {
|
|
74
|
+
if (credentialStatus !== 200 || credential === null) {
|
|
75
|
+
return new Response(null, { status: credentialStatus || 404 });
|
|
76
|
+
}
|
|
77
|
+
return Response.json({ credential });
|
|
78
|
+
}
|
|
79
|
+
if (url.includes("/api/profile")) {
|
|
80
|
+
if (profileStatus !== 200 || profile === null) {
|
|
81
|
+
return new Response(null, { status: profileStatus || 404 });
|
|
82
|
+
}
|
|
83
|
+
return Response.json({ profile });
|
|
84
|
+
}
|
|
85
|
+
return new Response(null, { status: 404 });
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
describe("successful login", () => {
|
|
89
|
+
it("should authenticate user and transition through status states", async () => {
|
|
90
|
+
const credential = createMockCredential(TEST_USER_DID, appDid);
|
|
91
|
+
mockFetch({ credential });
|
|
92
|
+
const statuses = [];
|
|
93
|
+
renown.on("status", (status) => statuses.push(status));
|
|
94
|
+
expect(renown.status).toBe("initial");
|
|
95
|
+
const user = await renown.login(TEST_USER_DID);
|
|
96
|
+
expect(user.did).toBe(TEST_USER_DID);
|
|
97
|
+
expect(user.address).toBe(TEST_ADDRESS);
|
|
98
|
+
expect(user.networkId).toBe("eip155");
|
|
99
|
+
expect(user.chainId).toBe(1);
|
|
100
|
+
expect(user.credential).toStrictEqual(credential);
|
|
101
|
+
expect(renown.status).toBe("authorized");
|
|
102
|
+
expect(statuses).toEqual(["checking", "authorized"]);
|
|
103
|
+
});
|
|
104
|
+
it("should emit user event on login", async () => {
|
|
105
|
+
const credential = createMockCredential(TEST_USER_DID, appDid);
|
|
106
|
+
mockFetch({ credential });
|
|
107
|
+
const users = [];
|
|
108
|
+
renown.on("user", (user) => users.push(user));
|
|
109
|
+
await renown.login(TEST_USER_DID);
|
|
110
|
+
expect(users).toHaveLength(1);
|
|
111
|
+
expect(users[0]?.did).toBe(TEST_USER_DID);
|
|
112
|
+
});
|
|
113
|
+
it("should persist user in storage", async () => {
|
|
114
|
+
const credential = createMockCredential(TEST_USER_DID, appDid);
|
|
115
|
+
mockFetch({ credential });
|
|
116
|
+
await renown.login(TEST_USER_DID);
|
|
117
|
+
expect(renown.user).toBeDefined();
|
|
118
|
+
expect(renown.user?.did).toBe(TEST_USER_DID);
|
|
119
|
+
});
|
|
120
|
+
it("should call credential API with correct parameters", async () => {
|
|
121
|
+
const credential = createMockCredential(TEST_USER_DID, appDid);
|
|
122
|
+
mockFetch({ credential });
|
|
123
|
+
await renown.login(TEST_USER_DID);
|
|
124
|
+
expect(globalThis.fetch).toHaveBeenCalledWith(expect.objectContaining({
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
126
|
+
href: expect.stringContaining("/api/auth/credential"),
|
|
127
|
+
}), expect.objectContaining({ method: "GET" }));
|
|
128
|
+
const fetchCall = vi.mocked(globalThis.fetch).mock.calls[0];
|
|
129
|
+
const url = fetchCall[0];
|
|
130
|
+
const params = new URL(url.toString()).searchParams;
|
|
131
|
+
expect(params.get("address")).toBe(TEST_ADDRESS);
|
|
132
|
+
expect(params.get("chainId")).toBe("1");
|
|
133
|
+
expect(params.get("connectId")).toBe(appDid);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
describe("profile fetching", () => {
|
|
137
|
+
it("should enrich user with profile data in the background", async () => {
|
|
138
|
+
const credential = createMockCredential(TEST_USER_DID, appDid);
|
|
139
|
+
mockFetch({ credential });
|
|
140
|
+
await renown.login(TEST_USER_DID);
|
|
141
|
+
// Wait for background profile fetch
|
|
142
|
+
await vi.waitFor(() => {
|
|
143
|
+
expect(renown.user?.profile).toBeDefined();
|
|
144
|
+
});
|
|
145
|
+
expect(renown.user?.profile?.documentId).toBe("doc-123");
|
|
146
|
+
expect(renown.user?.profile?.username).toBe("testuser");
|
|
147
|
+
expect(renown.user?.ens?.name).toBe("testuser");
|
|
148
|
+
expect(renown.user?.ens?.avatarUrl).toBe("https://example.com/avatar.png");
|
|
149
|
+
});
|
|
150
|
+
it("should emit a second user event after profile fetch", async () => {
|
|
151
|
+
const credential = createMockCredential(TEST_USER_DID, appDid);
|
|
152
|
+
mockFetch({ credential });
|
|
153
|
+
const users = [];
|
|
154
|
+
renown.on("user", (user) => users.push(user));
|
|
155
|
+
await renown.login(TEST_USER_DID);
|
|
156
|
+
await vi.waitFor(() => {
|
|
157
|
+
expect(users).toHaveLength(2);
|
|
158
|
+
});
|
|
159
|
+
// First emission: user without profile
|
|
160
|
+
expect(users[0]?.profile).toBeUndefined();
|
|
161
|
+
// Second emission: user with profile
|
|
162
|
+
expect(users[1]?.profile?.documentId).toBe("doc-123");
|
|
163
|
+
});
|
|
164
|
+
it("should call profile API with correct parameters", async () => {
|
|
165
|
+
const credential = createMockCredential(TEST_USER_DID, appDid);
|
|
166
|
+
mockFetch({ credential });
|
|
167
|
+
await renown.login(TEST_USER_DID);
|
|
168
|
+
await vi.waitFor(() => {
|
|
169
|
+
expect(renown.user?.profile).toBeDefined();
|
|
170
|
+
});
|
|
171
|
+
const profileCall = vi
|
|
172
|
+
.mocked(globalThis.fetch)
|
|
173
|
+
.mock.calls.find((call) => String(call[0]).includes("/api/profile"));
|
|
174
|
+
expect(profileCall).toBeDefined();
|
|
175
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
176
|
+
const body = JSON.parse(profileCall[1].body);
|
|
177
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
178
|
+
expect(body.ethAddress).toBe(TEST_ADDRESS);
|
|
179
|
+
});
|
|
180
|
+
it("should handle profile fetch failure gracefully", async () => {
|
|
181
|
+
const credential = createMockCredential(TEST_USER_DID, appDid);
|
|
182
|
+
mockFetch({ credential, profileStatus: 500 });
|
|
183
|
+
const user = await renown.login(TEST_USER_DID);
|
|
184
|
+
// Login should succeed even if profile fails
|
|
185
|
+
expect(user.did).toBe(TEST_USER_DID);
|
|
186
|
+
expect(renown.status).toBe("authorized");
|
|
187
|
+
// Give time for background fetch to complete
|
|
188
|
+
await new Promise((r) => setTimeout(r, 50));
|
|
189
|
+
// Profile should remain undefined
|
|
190
|
+
expect(renown.user?.profile).toBeUndefined();
|
|
191
|
+
});
|
|
192
|
+
it("should not update user if they logged out before profile returns", async () => {
|
|
193
|
+
const credential = createMockCredential(TEST_USER_DID, appDid);
|
|
194
|
+
// Make profile fetch slow
|
|
195
|
+
vi.spyOn(globalThis, "fetch").mockImplementation(async (input) => {
|
|
196
|
+
const url = String(input);
|
|
197
|
+
if (url.includes("/api/auth/credential")) {
|
|
198
|
+
return Response.json({ credential });
|
|
199
|
+
}
|
|
200
|
+
if (url.includes("/api/profile")) {
|
|
201
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
202
|
+
return Response.json({ profile: MOCK_PROFILE });
|
|
203
|
+
}
|
|
204
|
+
return new Response(null, { status: 404 });
|
|
205
|
+
});
|
|
206
|
+
await renown.login(TEST_USER_DID);
|
|
207
|
+
await renown.logout();
|
|
208
|
+
// Wait for slow profile fetch to resolve
|
|
209
|
+
await new Promise((r) => setTimeout(r, 200));
|
|
210
|
+
// User should remain undefined after logout
|
|
211
|
+
expect(renown.user).toBeUndefined();
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
describe("login errors", () => {
|
|
215
|
+
it("should throw when credential is not found", async () => {
|
|
216
|
+
mockFetch({ credential: null, credentialStatus: 404 });
|
|
217
|
+
await expect(renown.login(TEST_USER_DID)).rejects.toThrow("Failed to get credential: 404");
|
|
218
|
+
expect(renown.status).toBe("not-authorized");
|
|
219
|
+
expect(renown.user).toBeUndefined();
|
|
220
|
+
});
|
|
221
|
+
it("should throw when credential issuer does not match userDid", async () => {
|
|
222
|
+
const credential = createMockCredential("did:pkh:eip155:1:0xDEADBEEF", appDid);
|
|
223
|
+
mockFetch({ credential });
|
|
224
|
+
await expect(renown.login(TEST_USER_DID)).rejects.toThrow("Invalid credential");
|
|
225
|
+
expect(renown.status).toBe("not-authorized");
|
|
226
|
+
});
|
|
227
|
+
it("should throw when credential subject does not match app DID", async () => {
|
|
228
|
+
const credential = createMockCredential(TEST_USER_DID, "did:key:wrong");
|
|
229
|
+
mockFetch({ credential });
|
|
230
|
+
await expect(renown.login(TEST_USER_DID)).rejects.toThrow("Invalid credential");
|
|
231
|
+
expect(renown.status).toBe("not-authorized");
|
|
232
|
+
});
|
|
233
|
+
it("should throw for invalid DID format", async () => {
|
|
234
|
+
await expect(renown.login("invalid-did")).rejects.toThrow("Invalid pkh did");
|
|
235
|
+
expect(renown.status).toBe("not-authorized");
|
|
236
|
+
});
|
|
237
|
+
it("should emit status and user events on failure", async () => {
|
|
238
|
+
mockFetch({ credential: null, credentialStatus: 404 });
|
|
239
|
+
const statuses = [];
|
|
240
|
+
const users = [];
|
|
241
|
+
renown.on("status", (s) => statuses.push(s));
|
|
242
|
+
renown.on("user", (u) => users.push(u));
|
|
243
|
+
await expect(renown.login(TEST_USER_DID)).rejects.toThrow();
|
|
244
|
+
expect(statuses).toEqual(["checking", "not-authorized"]);
|
|
245
|
+
expect(users).toEqual([undefined]);
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
describe("logout", () => {
|
|
249
|
+
it("should clear user and set status to not-authorized", async () => {
|
|
250
|
+
const credential = createMockCredential(TEST_USER_DID, appDid);
|
|
251
|
+
mockFetch({ credential });
|
|
252
|
+
await renown.login(TEST_USER_DID);
|
|
253
|
+
expect(renown.user).toBeDefined();
|
|
254
|
+
expect(renown.status).toBe("authorized");
|
|
255
|
+
await renown.logout();
|
|
256
|
+
expect(renown.user).toBeUndefined();
|
|
257
|
+
expect(renown.status).toBe("not-authorized");
|
|
258
|
+
});
|
|
259
|
+
it("should emit user and status events on logout", async () => {
|
|
260
|
+
const credential = createMockCredential(TEST_USER_DID, appDid);
|
|
261
|
+
mockFetch({ credential });
|
|
262
|
+
await renown.login(TEST_USER_DID);
|
|
263
|
+
const statuses = [];
|
|
264
|
+
const users = [];
|
|
265
|
+
renown.on("status", (s) => statuses.push(s));
|
|
266
|
+
renown.on("user", (u) => users.push(u));
|
|
267
|
+
await renown.logout();
|
|
268
|
+
expect(statuses).toEqual(["not-authorized"]);
|
|
269
|
+
expect(users).toEqual([undefined]);
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
describe("event subscriptions", () => {
|
|
273
|
+
it("should return unsubscribe function from on()", async () => {
|
|
274
|
+
const credential = createMockCredential(TEST_USER_DID, appDid);
|
|
275
|
+
mockFetch({ credential });
|
|
276
|
+
const statuses = [];
|
|
277
|
+
const unsubscribe = renown.on("status", (s) => statuses.push(s));
|
|
278
|
+
await renown.login(TEST_USER_DID);
|
|
279
|
+
expect(statuses).toEqual(["checking", "authorized"]);
|
|
280
|
+
unsubscribe();
|
|
281
|
+
await renown.logout();
|
|
282
|
+
// Should not receive the "not-authorized" event after unsubscribe
|
|
283
|
+
expect(statuses).toEqual(["checking", "authorized"]);
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
//# sourceMappingURL=renown.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renown.test.js","sourceRoot":"","sources":["../../test/renown.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D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