A lexicon-driven AppView for ATProto. happyview.dev
backfill firehose jetstream atproto appview oauth lexicon
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

test(sdk): fix deleteSession tests

Trezy 3c264f54 3f02b515

+24 -3
+24 -3
packages/oauth-client/src/__tests__/client.test.ts
··· 200 200 201 201 describe("deleteSession", () => { 202 202 test("calls DELETE /oauth/sessions/:did", async () => { 203 + const testJwk = await generateTestJwk(); 203 204 const { fetchFn, calls } = createMockFetch([ 204 205 { status: 204, body: null }, 205 206 ]); ··· 207 208 const storage = new MemoryStorage(); 208 209 await storage.set( 209 210 "happyview:session:did:plc:testuser", 210 - JSON.stringify({ did: "did:plc:testuser" }), 211 + JSON.stringify({ 212 + did: "did:plc:testuser", 213 + dpopKey: testJwk, 214 + accessToken: "at_token", 215 + clientKey: "hvc_testkey", 216 + instanceUrl: "https://happyview.example.com", 217 + }), 211 218 ); 212 219 await storage.set("happyview:last-active-did", "did:plc:testuser"); 213 220 ··· 225 232 }); 226 233 227 234 test("clears session and last active DID from storage", async () => { 235 + const testJwk = await generateTestJwk(); 228 236 const { fetchFn } = createMockFetch([{ status: 204, body: null }]); 229 237 230 238 const storage = new MemoryStorage(); 231 239 await storage.set( 232 240 "happyview:session:did:plc:testuser", 233 - JSON.stringify({ did: "did:plc:testuser" }), 241 + JSON.stringify({ 242 + did: "did:plc:testuser", 243 + dpopKey: testJwk, 244 + accessToken: "at_token", 245 + clientKey: "hvc_testkey", 246 + instanceUrl: "https://happyview.example.com", 247 + }), 234 248 ); 235 249 await storage.set("happyview:last-active-did", "did:plc:testuser"); 236 250 ··· 248 262 }); 249 263 250 264 test("preserves last active DID when deleting a different session", async () => { 265 + const testJwk = await generateTestJwk(); 251 266 const { fetchFn } = createMockFetch([{ status: 204, body: null }]); 252 267 253 268 const storage = new MemoryStorage(); 254 269 await storage.set( 255 270 "happyview:session:did:plc:other", 256 - JSON.stringify({ did: "did:plc:other" }), 271 + JSON.stringify({ 272 + did: "did:plc:other", 273 + dpopKey: testJwk, 274 + accessToken: "at_token", 275 + clientKey: "hvc_testkey", 276 + instanceUrl: "https://happyview.example.com", 277 + }), 257 278 ); 258 279 await storage.set("happyview:last-active-did", "did:plc:testuser"); 259 280