Fix to feeds view in profiles (#1171)
* Fix load of feeds tab * Add e2e test for profile feeds
This commit is contained in:
+26
-1
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user