@atproto/bsky 0.0.84 → 0.0.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -516,6 +516,50 @@ describe('pds author feed views', () => {
516
516
  expect(AppBskyFeedDefs.isReasonPin(pinnedPost?.reason)).toBeFalsy()
517
517
  expect(forSnapshot(data.feed)).toMatchSnapshot()
518
518
  })
519
+
520
+ it("cannot pin someone else's post", async () => {
521
+ const bobPost = await sc.post(bob, 'pinned post')
522
+ await sc.post(alice, 'not pinned post')
523
+ await network.processAll()
524
+
525
+ const profile = await pdsAgent.com.atproto.repo.getRecord({
526
+ repo: alice,
527
+ collection: 'app.bsky.actor.profile',
528
+ rkey: 'self',
529
+ })
530
+
531
+ if (!AppBskyActorProfile.isRecord(profile.data.value)) {
532
+ throw new Error('')
533
+ }
534
+
535
+ const newProfile: AppBskyActorProfile.Record = {
536
+ ...profile,
537
+ pinnedPost: {
538
+ uri: bobPost.ref.uriStr,
539
+ cid: bobPost.ref.cid.toString(),
540
+ },
541
+ }
542
+
543
+ await sc.updateProfile(alice, newProfile)
544
+
545
+ await network.processAll()
546
+
547
+ const { data } = await agent.api.app.bsky.feed.getAuthorFeed(
548
+ { actor: sc.accounts[alice].handle },
549
+ {
550
+ headers: await network.serviceHeaders(
551
+ alice,
552
+ ids.AppBskyFeedGetAuthorFeed,
553
+ ),
554
+ },
555
+ )
556
+
557
+ const pinnedPost = data.feed.find(
558
+ (item) => item.post.uri === bobPost.ref.uriStr,
559
+ )
560
+ expect(pinnedPost).toBeUndefined()
561
+ expect(forSnapshot(data.feed)).toMatchSnapshot()
562
+ })
519
563
  })
520
564
  })
521
565