mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Fix emails backend tests
This commit is contained in:
parent
a8cfdf8192
commit
066505bcdb
@ -187,7 +187,7 @@ describe('VerifyEmailAddress', () => {
|
||||
let emailAddress
|
||||
beforeEach(async () => {
|
||||
emailAddress = await Factory.build('unverifiedEmailAddress', {
|
||||
nonce: 'abcdef',
|
||||
nonce: '12345',
|
||||
verifiedAt: null,
|
||||
createdAt: new Date().toISOString(),
|
||||
email: 'to-be-verified@example.org',
|
||||
@ -206,7 +206,7 @@ describe('VerifyEmailAddress', () => {
|
||||
|
||||
describe('given valid nonce for `UnverifiedEmailAddress` node', () => {
|
||||
beforeEach(() => {
|
||||
variables = { ...variables, nonce: 'abcdef' }
|
||||
variables = { ...variables, nonce: '12345' }
|
||||
})
|
||||
|
||||
describe('but the address does not belong to the authenticated user', () => {
|
||||
@ -300,8 +300,8 @@ describe('VerifyEmailAddress', () => {
|
||||
|
||||
describe('VerifyNonce', () => {
|
||||
beforeEach(async () => {
|
||||
await Factory.build('unverifiedEmailAddress', {
|
||||
nonce: 'abcdef',
|
||||
await Factory.build('emailAddress', {
|
||||
nonce: '12345',
|
||||
verifiedAt: null,
|
||||
createdAt: new Date().toISOString(),
|
||||
email: 'to-be-verified@example.org',
|
||||
@ -316,8 +316,8 @@ describe('VerifyNonce', () => {
|
||||
|
||||
it('returns true when nonce and email match', async () => {
|
||||
variables = {
|
||||
nonce: 'abcdef',
|
||||
email: 'to-be-verified@example.org',
|
||||
nonce: '12345',
|
||||
}
|
||||
await expect(query({ query: verifyNonceQuery, variables })).resolves.toMatchObject({
|
||||
data: { VerifyNonce: true },
|
||||
@ -326,8 +326,8 @@ describe('VerifyNonce', () => {
|
||||
|
||||
it('returns false when nonce and email do not match', async () => {
|
||||
variables = {
|
||||
nonce: '---',
|
||||
email: 'to-be-verified@example.org',
|
||||
nonce: '---',
|
||||
}
|
||||
await expect(query({ query: verifyNonceQuery, variables })).resolves.toMatchObject({
|
||||
data: { VerifyNonce: false },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user