Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/schemas/profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@
"title": "farcaster",
"pattern": "^[a-z0-9-]*$",
"maxLength": 17
},
"emailSubscription": {
"type": "object",
"properties": {
"email": {
"type": "string",
"title": "email",
"maxLength": 256
},
"subscriptions": {
"type": "array",
"title": "subscriptions",
"uniqueItems": true,
"items": { "type": "string" }
}
},
"required": [],
"additionalProperties": false
}
},
"required": [],
Expand Down
8 changes: 8 additions & 0 deletions test/examples/profile-addEmailSubscription.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Vitalik",
"avatar": "ipfs://NnVTdgcFciJUoxqgsNe9Hy2R7rgvEb5jDu5Pa5mmEG3UghbubTf2M78jUXbKLqKM",
"about": "This is my about info",
"emailSubscription": {
"email": "[email protected]"
}
}
8 changes: 8 additions & 0 deletions test/examples/profile-updateEmailSubscription.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Vitalik",
"avatar": "ipfs://NnVTdgcFciJUoxqgsNe9Hy2R7rgvEb5jDu5Pa5mmEG3UghbubTf2M78jUXbKLqKM",
"about": "This is my about info",
"emailSubscription": {
"subscriptions": ["summary", "newProposal"]
}
}
12 changes: 12 additions & 0 deletions test/schema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import spaceStarknetDelegation from './examples/space-starknet-delegation.json';
import proposalTurbo from './examples/proposal-turbo.json';
import vote from './examples/vote.json';
import profile from './examples/profile.json';
import profileAddEmailSubscription from './examples/profile-addEmailSubscription.json';
import profileUpdateEmailSubscription from './examples/profile-updateEmailSubscription.json';
import statement from './examples/statement.json';
import alias from './examples/alias.json';
import schemas from '../src/schemas';
Expand All @@ -24,6 +26,16 @@ describe.each([
{ schemaType: 'proposal', schema: schemas.proposal, example: proposal },
{ schemaType: 'vote', schema: schemas.vote, example: vote },
{ schemaType: 'profile', schema: schemas.profile, example: profile },
{
schemaType: 'profile',
schema: schemas.profile,
example: profileAddEmailSubscription
},
{
schemaType: 'profile',
schema: schemas.profile,
example: profileUpdateEmailSubscription
},
{ schemaType: 'statement', schema: schemas.statement, example: statement },
{ schemaType: 'zodiac', schema: schemas.zodiac, example: space },
{ schemaType: 'alias', schema: schemas.alias, example: alias }
Expand Down
Loading