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', () => {
|
||||
cy.viewport('macbook-15');
|
||||
cy.mockGraphql({
|
||||
schema: schema,
|
||||
operations: {
|
||||
Coupon: {
|
||||
coupon: {
|
||||
success: true,
|
||||
result: {
|
||||
__typename: 'Success',
|
||||
message: 'Yay!',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -44,7 +46,14 @@ describe('Email Verification', () => {
|
|||
cy.mockGraphql({
|
||||
schema: schema,
|
||||
operations: {
|
||||
Coupon: new GraphQLError('invalid_coupon'),
|
||||
Coupon: {
|
||||
coupon: {
|
||||
result: {
|
||||
__typename: 'InvalidCoupon',
|
||||
reason: 'No no',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
cy.apolloLogin('rachel.green', 'test');
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ const mockGraphql = (options?: any) => {
|
|||
const resolverMap = {
|
||||
DeleteSnapshotResult: typenameResolver,
|
||||
UpdateSnapshotResult: typenameResolver,
|
||||
RedeemCouponResult: typenameResolver,
|
||||
};
|
||||
const schema = makeExecutableSchema({
|
||||
typeDefs: schemaString,
|
||||
|
|
@ -225,7 +226,7 @@ Cypress.Commands.add('openSidebar', () => {
|
|||
});
|
||||
|
||||
Cypress.Commands.add('setup', () => {
|
||||
cy.fakeLogin('nino.teacher', 'test');
|
||||
cy.fakeLogin();
|
||||
cy.viewport('macbook-15');
|
||||
cy.mockGraphql();
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue