about summary refs log tree commit diff
path: root/jest
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-08-15 09:59:49 -0700
committerGitHub <noreply@github.com>2023-08-15 09:59:49 -0700
commitf4891a47a17cdcd35751867153f73350c90a8f72 (patch)
tree97d1a20437470ff1718561b3ec28e18865607c64 /jest
parenta3af2a2b850f5561d5a0b9504e0b6ea9aca07cb7 (diff)
downloadvoidsky-f4891a47a17cdcd35751867153f73350c90a8f72.tar.zst
Fix to feeds view in profiles (#1171)
* Fix load of feeds tab

* Add e2e test for profile feeds
Diffstat (limited to 'jest')
-rw-r--r--jest/test-pds.ts27
1 files changed, 26 insertions, 1 deletions
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(