Skip to content

Commit

Permalink
fix actor takedown tests
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey committed Aug 17, 2023
1 parent ff0d2df commit 4347a21
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
14 changes: 8 additions & 6 deletions packages/bsky/tests/views/author-feed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,14 @@ describe('pds author feed views', () => {
},
)

const { data: postBlock } = await agent.api.app.bsky.feed.getAuthorFeed(
{ actor: alice },
{ headers: await network.serviceHeaders(carol) },
)

expect(postBlock.feed.length).toEqual(0)
try {
const { data: postBlock } = await agent.api.app.bsky.feed.getAuthorFeed(
{ actor: alice },
{ headers: await network.serviceHeaders(carol) },
)
} catch (e: any) {
expect(e.message).toEqual('Profile not found')
}

// Cleanup
await agent.api.com.atproto.admin.reverseModerationAction(
Expand Down
15 changes: 9 additions & 6 deletions packages/pds/tests/views/author-feed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import basicSeed from '../seeds/basic'
import { isRecord } from '../../src/lexicon/types/app/bsky/feed/post'
import { isView as isEmbedRecordWithMedia } from '../../src/lexicon/types/app/bsky/embed/recordWithMedia'
import { isView as isImageEmbed } from '../../src/lexicon/types/app/bsky/embed/images'
import { InvalidRequestError } from '@atproto/xrpc-server'

describe('pds author feed views', () => {
let agent: AtpAgent
Expand Down Expand Up @@ -196,12 +197,14 @@ describe('pds author feed views', () => {
did: alice,
})

const { data: postBlock } = await agent.api.app.bsky.feed.getAuthorFeed(
{ actor: alice },
{ headers: sc.getHeaders(carol) },
)

expect(postBlock.feed.length).toEqual(0)
try {
await agent.api.app.bsky.feed.getAuthorFeed(
{ actor: alice },
{ headers: sc.getHeaders(carol) },
)
} catch (e: any) {
expect(e.message).toEqual('Profile not found')
}

// Cleanup
await reverseModerationAction(action.id)
Expand Down

0 comments on commit 4347a21

Please sign in to comment.