Fix e2e test
This commit is contained in:
parent
a686d84968
commit
ad9a7bb697
|
|
@ -14,11 +14,13 @@ describe('Email Verification', () => {
|
||||||
it('forwards to homepage if confirmation key is correct', () => {
|
it('forwards to homepage if confirmation key is correct', () => {
|
||||||
cy.viewport('macbook-15');
|
cy.viewport('macbook-15');
|
||||||
cy.mockGraphql({
|
cy.mockGraphql({
|
||||||
schema: schema,
|
|
||||||
operations: {
|
operations: {
|
||||||
Coupon: {
|
Coupon: {
|
||||||
coupon: {
|
coupon: {
|
||||||
success: true,
|
result: {
|
||||||
|
__typename: 'Success',
|
||||||
|
message: 'Yay!',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -44,7 +46,14 @@ describe('Email Verification', () => {
|
||||||
cy.mockGraphql({
|
cy.mockGraphql({
|
||||||
schema: schema,
|
schema: schema,
|
||||||
operations: {
|
operations: {
|
||||||
Coupon: new GraphQLError('invalid_coupon'),
|
Coupon: {
|
||||||
|
coupon: {
|
||||||
|
result: {
|
||||||
|
__typename: 'InvalidCoupon',
|
||||||
|
reason: 'No no',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
cy.apolloLogin('rachel.green', 'test');
|
cy.apolloLogin('rachel.green', 'test');
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ const mockGraphql = (options?: any) => {
|
||||||
const resolverMap = {
|
const resolverMap = {
|
||||||
DeleteSnapshotResult: typenameResolver,
|
DeleteSnapshotResult: typenameResolver,
|
||||||
UpdateSnapshotResult: typenameResolver,
|
UpdateSnapshotResult: typenameResolver,
|
||||||
|
RedeemCouponResult: typenameResolver,
|
||||||
};
|
};
|
||||||
const schema = makeExecutableSchema({
|
const schema = makeExecutableSchema({
|
||||||
typeDefs: schemaString,
|
typeDefs: schemaString,
|
||||||
|
|
@ -225,7 +226,7 @@ Cypress.Commands.add('openSidebar', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('setup', () => {
|
Cypress.Commands.add('setup', () => {
|
||||||
cy.fakeLogin('nino.teacher', 'test');
|
cy.fakeLogin();
|
||||||
cy.viewport('macbook-15');
|
cy.viewport('macbook-15');
|
||||||
cy.mockGraphql();
|
cy.mockGraphql();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue