Fix to feeds view in profiles (#1171)
* Fix load of feeds tab * Add e2e test for profile feeds
This commit is contained in:
parent
a3af2a2b85
commit
f4891a47a1
5 changed files with 46 additions and 17 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue