Skip to content

Commit

Permalink
Revert "add failing test for pinning someone else's post"
Browse files Browse the repository at this point in the history
This reverts commit 734f5d5.
  • Loading branch information
mozzius committed Sep 30, 2024
1 parent 734f5d5 commit 16a2399
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions packages/bsky/tests/views/author-feed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,50 +516,6 @@ describe('pds author feed views', () => {
expect(AppBskyFeedDefs.isReasonPin(pinnedPost?.reason)).toBeFalsy()
expect(forSnapshot(data.feed)).toMatchSnapshot()
})

it("cannot pin someone else's post", async () => {
const bobPost = await sc.post(bob, 'pinned post')
await sc.post(alice, 'not pinned post')
await network.processAll()

const profile = await pdsAgent.com.atproto.repo.getRecord({
repo: alice,
collection: 'app.bsky.actor.profile',
rkey: 'self',
})

if (!AppBskyActorProfile.isRecord(profile.data.value)) {
throw new Error('')
}

const newProfile: AppBskyActorProfile.Record = {
...profile,
pinnedPost: {
uri: bobPost.ref.uriStr,
cid: bobPost.ref.cid.toString(),
},
}

await sc.updateProfile(alice, newProfile)

await network.processAll()

const { data } = await agent.api.app.bsky.feed.getAuthorFeed(
{ actor: sc.accounts[alice].handle },
{
headers: await network.serviceHeaders(
alice,
ids.AppBskyFeedGetAuthorFeed,
),
},
)

const pinnedPost = data.feed.find(
(item) => item.post.uri === bobPost.ref.uriStr,
)
expect(pinnedPost).toBeUndefined()
expect(forSnapshot(data.feed)).toMatchSnapshot()
})
})
})

Expand Down

0 comments on commit 16a2399

Please sign in to comment.