Skip to content

Commit

Permalink
clean up proxy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Sep 12, 2023
1 parent 3090e7d commit 3010567
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions packages/pds/tests/proxied/admin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,19 +267,12 @@ describe('proxies admin requests', () => {
},
)
// check profile and labels
const tryGetProfilePds = agent.api.app.bsky.actor.getProfile(
{ actor: sc.dids.alice },
{ headers: sc.getHeaders(sc.dids.carol) },
)
const tryGetProfileAppview = agent.api.app.bsky.actor.getProfile(
{ actor: sc.dids.alice },
{
headers: { ...sc.getHeaders(sc.dids.carol), 'x-appview-proxy': 'true' },
},
)
await expect(tryGetProfilePds).rejects.toThrow(
'Account has been taken down',
)
await expect(tryGetProfileAppview).rejects.toThrow(
'Account has been taken down',
)
Expand All @@ -296,19 +289,12 @@ describe('proxies admin requests', () => {
},
)
// check profile and labels
const { data: profilePds } = await agent.api.app.bsky.actor.getProfile(
{ actor: sc.dids.alice },
{ headers: sc.getHeaders(sc.dids.carol) },
)
const { data: profileAppview } = await agent.api.app.bsky.actor.getProfile(
{ actor: sc.dids.alice },
{
headers: { ...sc.getHeaders(sc.dids.carol), 'x-appview-proxy': 'true' },
},
)
expect(profilePds).toEqual(
expect.objectContaining({ did: sc.dids.alice, handle: 'alice.test' }),
)
expect(profileAppview).toEqual(
expect.objectContaining({ did: sc.dids.alice, handle: 'alice.test' }),
)
Expand Down Expand Up @@ -342,17 +328,12 @@ describe('proxies admin requests', () => {
},
)
// check thread and labels
const tryGetPostPds = agent.api.app.bsky.feed.getPostThread(
{ uri: post.ref.uriStr, depth: 0 },
{ headers: sc.getHeaders(sc.dids.carol) },
)
const tryGetPostAppview = agent.api.app.bsky.feed.getPostThread(
{ uri: post.ref.uriStr, depth: 0 },
{
headers: { ...sc.getHeaders(sc.dids.carol), 'x-appview-proxy': 'true' },
},
)
await expect(tryGetPostPds).rejects.toThrow(NotFoundError)
await expect(tryGetPostAppview).rejects.toThrow(NotFoundError)
const labelsA = await services.appView
.label(db)
Expand All @@ -367,19 +348,12 @@ describe('proxies admin requests', () => {
},
)
// check thread and labels
const { data: threadPds } = await agent.api.app.bsky.feed.getPostThread(
{ uri: post.ref.uriStr, depth: 0 },
{ headers: sc.getHeaders(sc.dids.carol) },
)
const { data: threadAppview } = await agent.api.app.bsky.feed.getPostThread(
{ uri: post.ref.uriStr, depth: 0 },
{
headers: { ...sc.getHeaders(sc.dids.carol), 'x-appview-proxy': 'true' },
},
)
expect(threadPds.thread.post).toEqual(
expect.objectContaining({ uri: post.ref.uriStr, cid: post.ref.cidStr }),
)
expect(threadAppview.thread.post).toEqual(
expect.objectContaining({ uri: post.ref.uriStr, cid: post.ref.cidStr }),
)
Expand Down

0 comments on commit 3010567

Please sign in to comment.