Remove unused variables, simplify tests

This commit is contained in:
Christian Cueni 2020-05-12 08:11:51 +02:00
parent a0733d1caf
commit edd431671f
5 changed files with 15 additions and 25 deletions

View File

@ -4,7 +4,6 @@ const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, { module.exports = merge(prodEnv, {
NODE_ENV: '"development"', NODE_ENV: '"development"',
GOOGLE_ANALYTICS_ID: JSON.stringify(process.env.GOOGLE_ANALYTICS_ID),
HEP_URL: JSON.stringify(process.env.HEP_URL), HEP_URL: JSON.stringify(process.env.HEP_URL),
MATOMO_HOST: JSON.stringify(process.env.MATOMO_HOST), MATOMO_HOST: JSON.stringify(process.env.MATOMO_HOST),
MATOMO_SITE_ID: JSON.stringify(process.env.MATOMO_SITE_ID), MATOMO_SITE_ID: JSON.stringify(process.env.MATOMO_SITE_ID),

View File

@ -1,7 +1,6 @@
'use strict' 'use strict'
module.exports = { module.exports = {
NODE_ENV: '"production"', NODE_ENV: '"production"',
GOOGLE_ANALYTICS_ID: JSON.stringify(process.env.GOOGLE_ANALYTICS_ID),
HEP_URL: JSON.stringify(process.env.HEP_URL), HEP_URL: JSON.stringify(process.env.HEP_URL),
MATOMO_HOST: JSON.stringify(process.env.MATOMO_HOST), MATOMO_HOST: JSON.stringify(process.env.MATOMO_HOST),
MATOMO_SITE_ID: JSON.stringify(process.env.MATOMO_SITE_ID), MATOMO_SITE_ID: JSON.stringify(process.env.MATOMO_SITE_ID),

View File

@ -10,12 +10,10 @@ describe('Email Verifcation', () => {
cy.mockGraphql({ cy.mockGraphql({
schema: schema, schema: schema,
operations: { operations: {
Registration: variables => { Registration: {
return { registration: {
registration: { message: "success",
message: "success", success: true
success: true
}
} }
}, },
} }
@ -35,13 +33,11 @@ describe('Email Verifcation', () => {
schema: schema, schema: schema,
// endpoint: '/api/graphql' // endpoint: '/api/graphql'
operations: { operations: {
Registration: variables => { Registration: {
return {
registration: { registration: {
message: "invalid_key", message: "invalid_key",
success: false success: false
} }
}
}, },
} }
}); });
@ -58,12 +54,10 @@ describe('Email Verifcation', () => {
schema: schema, schema: schema,
// endpoint: '/api/graphql' // endpoint: '/api/graphql'
operations: { operations: {
Registration: variables => { Registration: {
return { registration: {
registration: { message: "unkown_error",
message: "unkown_error", success: false
success: false
}
} }
}, },
} }
@ -80,12 +74,10 @@ describe('Email Verifcation', () => {
schema: schema, schema: schema,
// endpoint: '/api/graphql' // endpoint: '/api/graphql'
operations: { operations: {
Registration: variables => { Registration: {
return { registration: {
registration: { message: "no_valid_license",
message: "no_valid_license", success: false
success: false
}
} }
}, },
} }

View File

@ -37,7 +37,7 @@ describe('Login', () => {
cy.get('[data-cy="login-title"]').contains('Bitte geben Sie das passende Passwort ein'); cy.get('[data-cy="login-title"]').contains('Bitte geben Sie das passende Passwort ein');
cy.enterPassword('abcd1234'); cy.enterPassword('abcd1234');
// As we cannot set the cookie in the right manner, we just check for the absence of erros. // As we cannot set the cookie in the right manner, we just check for the absence of errors.
// In real world the user gets redirect to another page // In real world the user gets redirect to another page
cy.get('[data-cy="email-local-errors"]').should('not.exist'); cy.get('[data-cy="email-local-errors"]').should('not.exist');
}); });

View File

@ -37,7 +37,7 @@ class Registration(relay.ClientIDMutation):
hep_client.customer_activate(confirmation_key, user_id) hep_client.customer_activate(confirmation_key, user_id)
user_data = hep_client.customers_by_id(admin_token, user_id) user_data = hep_client.customers_by_id(admin_token, user_id)
# double check if user has verified his email. If the "confirmation" field is present, the email address # double check if user has verified his email. If the "confirmation" field is present, the email address
# is not verified. Note that the user should not be able to see this page without verified email. # is not verified.
if 'confirmation' in user_data: if 'confirmation' in user_data:
return cls.return_fail_registration_msg('invalid_key') return cls.return_fail_registration_msg('invalid_key')
except HepClientException: except HepClientException: