Fix the invite test construction

This commit is contained in:
Paul Frazee
2023-06-27 20:47:24 -05:00
parent 24f919d0de
commit dab22aa3e5
3 changed files with 19 additions and 2 deletions
+15 -1
View File
@@ -24,7 +24,6 @@ export async function createServer(
const port = await getPort()
const port2 = await getPort(port + 1)
const pdsUrl = `http://localhost:${port}`
console.log({port})
const {pds, plc} = await TestNetworkNoAppView.create({
pds: {port, publicUrl: pdsUrl, inviteRequired},
plc: {port: port2},
@@ -191,6 +190,21 @@ class Mocker {
return await agent.like(uri, cid)
}
async createInvite(forAccount: string) {
const agent = new BskyAgent({service: this.agent.service})
await agent.api.com.atproto.server.createInviteCode(
{useCount: 1, forAccount},
{
headers: {
authorization: `Basic ${btoa(
`admin:${this.pds.ctx.cfg.adminPassword}`,
)}`,
},
encoding: 'application/json',
},
)
}
async labelAccount(label: string, user: string) {
const did = this.users[user]?.did
if (!did) {