-
Notifications
You must be signed in to change notification settings - Fork 30
feat: add support_email to /info response
#175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d334f7b
5cf7b52
4928abe
f42ba05
e262f27
fd33fff
c431c74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -193,7 +193,54 @@ describe('MVP Express-mounted integration', () => { | |
| expect(response.body.interactive_domain).toBe('https://anchor.example.com'); | ||
| }); | ||
|
|
||
| it('2b) /info omits interactive_domain when not configured', async () => { | ||
| it('2b) /info includes support_email when configured', async () => { | ||
| const customDbUrl = makeSqliteDbUrlForTests(); | ||
| const customAnchor = createAnchor({ | ||
| network: { network: 'testnet' }, | ||
| server: {}, | ||
| security: { | ||
| sep10SigningKey: sep10ServerKeypair.secret(), | ||
| interactiveJwtSecret: 'jwt-test-secret-email', | ||
| distributionAccountSecret: 'distribution-test-secret', | ||
| }, | ||
| assets: { | ||
| assets: [ | ||
| { | ||
| code: 'USDC', | ||
| issuer: 'GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5', | ||
| }, | ||
| ], | ||
| }, | ||
| operational: { supportEmail: 'support@example.com' }, | ||
| framework: { | ||
| database: { provider: 'sqlite', url: customDbUrl }, | ||
| }, | ||
| }); | ||
|
|
||
| await customAnchor.init(); | ||
| const customInvoke = createMountedInvoker(customAnchor); | ||
| const response = await customInvoke({ path: '/info' }); | ||
| expect(response.status).toBe(200); | ||
| expect(response.body.support_email).toBe('support@example.com'); | ||
|
|
||
| await customAnchor.shutdown(); | ||
| const customDbPath = customDbUrl.startsWith('file:') | ||
| ? customDbUrl.slice('file:'.length) | ||
| : customDbUrl; | ||
| try { | ||
| unlinkSync(customDbPath); | ||
| } catch { | ||
| /* ignore */ | ||
| } | ||
| }); | ||
|
Comment on lines
+196
to
+235
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The setup and teardown logic for |
||
|
|
||
| it('2c) /info omits support_email when not configured', async () => { | ||
| const response = await invoke({ path: '/info' }); | ||
| expect(response.status).toBe(200); | ||
| expect(response.body).not.toHaveProperty('support_email'); | ||
| }); | ||
|
|
||
| it('2d) /info omits interactive_domain when not configured', async () => { | ||
| const customDbUrl = makeSqliteDbUrlForTests(); | ||
| const customAnchor = createAnchor({ | ||
| network: { network: 'testnet' }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,20 @@ | |
| * Verifies discriminated union narrowing and type compatibility | ||
| */ | ||
|
|
||
| import { describe, it, expectTypeOf, expect } from 'vitest'; | ||
| import { describe, it, expect } from 'vitest'; | ||
|
|
||
| /** | ||
| * Runtime no-op that preserves compile-time type assertions. | ||
| * Bun's test runner does not support vitest's `expectTypeOf` at runtime, | ||
| * so we use this shim instead. TypeScript still validates the type | ||
| * relationships at compile time via the generic constraints. | ||
| */ | ||
| function expectTypeOf<T>(_value?: T) { | ||
| return { | ||
| toEqualTypeOf<U>(_?: U): void {}, | ||
| toMatchTypeOf<U>(_?: U): void {}, | ||
| }; | ||
|
Comment on lines
+8
to
+18
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| import type { | ||
| DepositTransaction, | ||
| Sep24TransactionResponse, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.