From f4891a47a17cdcd35751867153f73350c90a8f72 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 15 Aug 2023 09:59:49 -0700 Subject: Fix to feeds view in profiles (#1171) * Fix load of feeds tab * Add e2e test for profile feeds --- jest/test-pds.ts | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'jest/test-pds.ts') diff --git a/jest/test-pds.ts b/jest/test-pds.ts index 48b73e848..0c9d946fc 100644 --- a/jest/test-pds.ts +++ b/jest/test-pds.ts @@ -2,7 +2,7 @@ import net from 'net' import path from 'path' import fs from 'fs' import {TestPds as DevEnvTestPDS, TestNetworkNoAppView} from '@atproto/dev-env' -import {BskyAgent} from '@atproto/api' +import {AtUri, BskyAgent} from '@atproto/api' export interface TestUser { email: string @@ -212,6 +212,31 @@ class Mocker { return await agent.like(uri, cid) } + async createFeed(user: string) { + const agent = this.users[user]?.agent + if (!agent) { + throw new Error(`Not a user: ${user}`) + } + const fg1Uri = AtUri.make( + this.users[user].did, + 'app.bsky.feed.generator', + 'alice-favs', + ) + const avatarRes = await agent.api.com.atproto.repo.uploadBlob(this.pic, { + encoding: 'image/png', + }) + return await agent.api.app.bsky.feed.generator.create( + {repo: this.users[user].did, rkey: fg1Uri.rkey}, + { + did: 'did:web:fake.com', + displayName: 'alices feed', + description: 'all my fav stuff', + avatar: avatarRes.data.blob, + createdAt: new Date().toISOString(), + }, + ) + } + async createInvite(forAccount: string) { const agent = new BskyAgent({service: this.agent.service}) await agent.api.com.atproto.server.createInviteCode( -- cgit 1.4.1