-
Notifications
You must be signed in to change notification settings - Fork 636
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polish on entryway blob uploads and gets (#1814)
* fix account creation to work between entryway and non-entryway * stream blob uploads * serve redirect to new pds on getBlob * tidy did doc session tests
- Loading branch information
Showing
6 changed files
with
371 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import assert from 'assert' | ||
import { defaultFetchHandler } from '@atproto/xrpc' | ||
import { | ||
AtpAgent, | ||
|
@@ -7,17 +6,13 @@ import { | |
AtpSessionData, | ||
} from '..' | ||
import { TestNetworkNoAppView } from '@atproto/dev-env' | ||
import { getPdsEndpoint, isValidDidDoc } from '@atproto/common-web' | ||
|
||
describe('agent', () => { | ||
let network: TestNetworkNoAppView | ||
|
||
beforeAll(async () => { | ||
network = await TestNetworkNoAppView.create({ | ||
dbPostgresSchema: 'api_agent', | ||
pds: { | ||
enableDidDocWithSession: true, | ||
}, | ||
}) | ||
}) | ||
|
||
|
@@ -48,19 +43,16 @@ describe('agent', () => { | |
expect(agent.session?.did).toEqual(res.data.did) | ||
expect(agent.session?.email).toEqual('[email protected]') | ||
expect(agent.session?.emailConfirmed).toEqual(false) | ||
assert(isValidDidDoc(res.data.didDoc)) | ||
expect(agent.api.xrpc.uri.origin).toEqual(getPdsEndpoint(res.data.didDoc)) | ||
|
||
const { data: sessionInfo } = await agent.api.com.atproto.server.getSession( | ||
{}, | ||
) | ||
expect(sessionInfo).toMatchObject({ | ||
expect(sessionInfo).toEqual({ | ||
did: res.data.did, | ||
handle: res.data.handle, | ||
email: '[email protected]', | ||
emailConfirmed: false, | ||
}) | ||
expect(isValidDidDoc(sessionInfo.didDoc)).toBe(true) | ||
|
||
expect(events.length).toEqual(1) | ||
expect(events[0]).toEqual('create') | ||
|
@@ -98,18 +90,15 @@ describe('agent', () => { | |
expect(agent2.session?.did).toEqual(res1.data.did) | ||
expect(agent2.session?.email).toEqual('[email protected]') | ||
expect(agent2.session?.emailConfirmed).toEqual(false) | ||
assert(isValidDidDoc(res1.data.didDoc)) | ||
expect(agent2.api.xrpc.uri.origin).toEqual(getPdsEndpoint(res1.data.didDoc)) | ||
|
||
const { data: sessionInfo } = | ||
await agent2.api.com.atproto.server.getSession({}) | ||
expect(sessionInfo).toMatchObject({ | ||
expect(sessionInfo).toEqual({ | ||
did: res1.data.did, | ||
handle: res1.data.handle, | ||
email, | ||
emailConfirmed: false, | ||
}) | ||
expect(isValidDidDoc(sessionInfo.didDoc)).toBe(true) | ||
|
||
expect(events.length).toEqual(2) | ||
expect(events[0]).toEqual('create') | ||
|
@@ -144,18 +133,15 @@ describe('agent', () => { | |
expect(agent2.hasSession).toEqual(true) | ||
expect(agent2.session?.handle).toEqual(res1.data.handle) | ||
expect(agent2.session?.did).toEqual(res1.data.did) | ||
assert(isValidDidDoc(res1.data.didDoc)) | ||
expect(agent2.api.xrpc.uri.origin).toEqual(getPdsEndpoint(res1.data.didDoc)) | ||
|
||
const { data: sessionInfo } = | ||
await agent2.api.com.atproto.server.getSession({}) | ||
expect(sessionInfo).toMatchObject({ | ||
expect(sessionInfo).toEqual({ | ||
did: res1.data.did, | ||
handle: res1.data.handle, | ||
email: res1.data.email, | ||
emailConfirmed: false, | ||
}) | ||
expect(isValidDidDoc(sessionInfo.didDoc)).toBe(true) | ||
|
||
expect(events.length).toEqual(2) | ||
expect(events[0]).toEqual('create') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.