From 8a05de5b2d907a1c8f2994c2232d12294908786f Mon Sep 17 00:00:00 2001 From: roschaefer Date: Tue, 24 Sep 2019 14:14:57 +0200 Subject: [PATCH] Sketch backend test to change Email Address --- backend/src/schema/resolvers/emails.spec.js | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 backend/src/schema/resolvers/emails.spec.js diff --git a/backend/src/schema/resolvers/emails.spec.js b/backend/src/schema/resolvers/emails.spec.js new file mode 100644 index 000000000..c947fa966 --- /dev/null +++ b/backend/src/schema/resolvers/emails.spec.js @@ -0,0 +1,36 @@ +describe('AddEmailAddress', () => { + it.todo('throws AuthorizationError') + describe('authenticated', () => { + it.todo('creates a new unverified `EmailAddress` node') + it.todo('connects EmailAddress to the authenticated user') + + describe('even if an unverified `EmailAddress` already exists with that email', () =>{ + it.todo('creates a new unverified `EmailAddress` node') + }) + }) +}) + +describe('VerifyEmailAddress', () => { + it.todo('throws AuthorizationError') + describe('authenticated', () => { + describe('if no unverified `EmailAddress` node exists', () => { + it.todo('throws UserInputError') + }) + + describe('given invalid nonce', () => { + it.todo('throws UserInputError') + }) + + describe('given valid nonce for unverified `EmailAddress` node', () => { + describe('but the address does not belong to the authenticated user', () => { + it.todo('throws UserInputError') + }) + + describe('and the `EmailAddress` belongs to the authenticated user', () => { + it.todo('verifies the `EmailAddress`') + it.todo('connects the new `EmailAddress` as PRIMARY') + it.todo('removes previous PRIMARY relationship') + }) + }) + }) +})