Skip to content

Commit

Permalink
fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sunilsabatp committed May 23, 2022
1 parent 01db46e commit f82a138
Show file tree
Hide file tree
Showing 6 changed files with 528 additions and 282 deletions.
29 changes: 19 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
env: {
node: true,
browser: true,
es2020: true,
},
Expand All @@ -18,16 +19,15 @@ module.exports = {
ecmaVersion: 11,
sourceType: 'module',
},
plugins: [
'react',
'@typescript-eslint',
'@emotion'
],
plugins: ['react', '@typescript-eslint', '@emotion', 'cypress'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/jsx-props-no-spreading': 'off',
'no-use-before-define': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.tsx'] }],
'react/jsx-filename-extension': [
1,
{ extensions: ['.js', '.jsx', '.tsx'] },
],
'react/jsx-indent': 'off',
'import/extensions': 'off',
'import/no-unresolved': 'off',
Expand All @@ -38,12 +38,21 @@ module.exports = {
'no-empty-pattern': 'off',
'react/display-name': 'off',
'react/no-find-dom-node': 'off',
"@emotion/jsx-import": "error",
"@emotion/no-vanilla": "error",
"@emotion/import-from-emotion": "error",
"@emotion/styled-import": "error"
'@emotion/jsx-import': 'error',
'@emotion/no-vanilla': 'error',
'@emotion/import-from-emotion': 'error',
'@emotion/styled-import': 'error',
'@typescript-eslint/no-var-requires': 0,
'react/prop-types': 'off',
'cypress/no-assigning-return-values': 'error',
'cypress/no-unnecessary-waiting': 'error',
'cypress/assertion-before-screenshot': 'warn',
'cypress/no-force': 'warn',
'cypress/no-async-tests': 'error',
'cypress/no-pause': 'error',
},
globals: {
React: 'writable',
cy: true,
},
};
107 changes: 54 additions & 53 deletions cypress/integration/donations.spec.js
Original file line number Diff line number Diff line change
@@ -1,60 +1,61 @@
/// <reference types="cypress" />

describe(("Donations"),() => {
it("Basic Donations",()=> {
cy.BasicDonation()
cy.cardPayment("4242424242424242", "424", "242")
})

it("Gift Donation", () => {
cy.giftDonation()
cy.cardPayment("4242424242424242", "424", "242")
})

// This test does not work in all enviroments as language is auto detected
// and "Germany" cannot be found in other languages then English.
//
// This also fails for other reasons:
// `cy.click()` failed because the center of this element is hidden from view
/*
import cy from 'cypress';

describe('Donations', () => {
it('Basic Donations', () => {
cy.BasicDonation();
cy.cardPayment('4242424242424242', '424', '242');
});

it('Gift Donation', () => {
cy.giftDonation();
cy.cardPayment('4242424242424242', '424', '242');
});

// This test does not work in all enviroments as language is auto detected
// and "Germany" cannot be found in other languages then English.
//
// This also fails for other reasons:
// `cy.click()` failed because the center of this element is hidden from view
/*
it("Change currency and custom tree donation", () => {
cy.customTreeDonation()
cy.cardPayment("4242424242424242", "424", "242")
})
*/

it("Multiple Donations", () => {
cy.multipleDonation()
cy.cardPayment("4242424242424242", "424", "242")
})

// International Cards
it("Testing with Germany Visa", () => {
cy.BasicDonation()
cy.cardPayment("4000002760000016", "424", "242")
});

it("Testing with Spain Visa", () => {
cy.spainDonation()
cy.cardPayment("4000007240000007", "424", "242")
});

// error testing
it("Testing with Charge declined error", () => {
cy.BasicDonation()
cy.paymentError("4000000000000002", "424", "242")
});
it("Testing with Insufficient funds error", () => {
cy.BasicDonation()
cy.paymentError("4000000000009995", "424", "242")
});
it("Testing with CVC fails", () => {
cy.BasicDonation()
cy.paymentError("4000000000000101", "424", "242")
});

it("Gift Removal using Search bar", () => {
cy.giftRemove()
cy.cardPayment("4242424242424242", "424", "242")
})
})
it('Multiple Donations', () => {
cy.multipleDonation();
cy.cardPayment('4242424242424242', '424', '242');
});

// International Cards
it('Testing with Germany Visa', () => {
cy.BasicDonation();
cy.cardPayment('4000002760000016', '424', '242');
});

it('Testing with Spain Visa', () => {
cy.spainDonation();
cy.cardPayment('4000007240000007', '424', '242');
});

// error testing
it('Testing with Charge declined error', () => {
cy.BasicDonation();
cy.paymentError('4000000000000002', '424', '242');
});
it('Testing with Insufficient funds error', () => {
cy.BasicDonation();
cy.paymentError('4000000000009995', '424', '242');
});
it('Testing with CVC fails', () => {
cy.BasicDonation();
cy.paymentError('4000000000000101', '424', '242');
});

it('Gift Removal using Search bar', () => {
cy.giftRemove();
cy.cardPayment('4242424242424242', '424', '242');
});
});
Loading

0 comments on commit f82a138

Please sign in to comment.