Skip to content

Commit 44f16a7

Browse files
Merge pull request #71 from mollie/feature/MOL-438/PICT-252
Feature/mol 438/pict 252
2 parents a179c6f + 79bbaa1 commit 44f16a7

34 files changed

+4696
-1644
lines changed

application/.eslintrc.ts renamed to application/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ process.env.ENABLE_NEW_JSX_TRANSFORM = 'true';
55
*/
66
module.exports = {
77
extends: ['@commercetools-frontend/eslint-config-mc-app'],
8-
plugins: ['graphql'],
8+
plugins: ['graphql', 'cypress'],
99
overrides: [
1010
{
1111
files: ['**/*.ctp.graphql'],

application/custom-application-config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ const config = {
3434
},
3535
headers: {
3636
csp: {
37-
'connect-src': [
38-
'*.europe-west1.gcp.commercetools.app',
39-
'*.europe-west1.gcp.commercetools.com',
40-
],
37+
'connect-src': ['*.euope-west1.gcp.commercetoolsr.app'],
4138
},
4239
},
4340
};

application/cypress.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export default defineConfig({
2020
}
2121

2222
on('task', { customApplicationConfig });
23-
// on('task', { customViewConfig });
2423
return {
2524
...cypressConfig,
2625
env: {
Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,59 @@
1+
/// <reference types="cypress" />
2+
/// <reference types="@testing-library/cypress" />
3+
/// <reference types="@commercetools-frontend/cypress" />
4+
15
import {
26
entryPointUriPath,
37
APPLICATION_BASE_ROUTE,
48
} from '../support/constants';
59

6-
describe('Test welcome.cy.', () => {
10+
describe('Test welcome.cy.ts', () => {
711
beforeEach(() => {
812
cy.loginToMerchantCenter({
913
entryPointUriPath,
1014
initialRoute: APPLICATION_BASE_ROUTE,
1115
});
1216
});
13-
it('should render page', () => {
14-
cy.findByText('Mollie').should('exist');
15-
cy.findByText('Content will follow...').should('exist');
17+
it('should render payment methods list', () => {
18+
cy.fixture('forward-to').then((response) => {
19+
cy.intercept('GET', '/proxy/forward-to', {
20+
statusCode: 200,
21+
body: response,
22+
});
23+
});
24+
25+
const paymentMethods = [
26+
'PayPal',
27+
'iDEAL Pay in 3 instalments, 0% interest',
28+
'iDEAL',
29+
'Bancontact',
30+
'Blik',
31+
];
32+
33+
const headers = ['Payment method', 'Active', 'Icon', 'Display order'];
34+
35+
cy.findByText('Mollie payment methods').should('exist');
36+
cy.findByText('Content will follow...').should('not.exist');
37+
38+
headers.forEach((header) => {
39+
cy.findByText(header).should('exist');
40+
});
41+
42+
paymentMethods.forEach((paymentMethod) => {
43+
cy.findByText(paymentMethod).should('exist');
44+
});
45+
});
46+
47+
it('should render no data notification', () => {
48+
cy.fixture('forward-to').then((response) => {
49+
cy.intercept('GET', '/proxy/forward-to', {
50+
statusCode: 200,
51+
body: {},
52+
});
53+
});
54+
55+
cy.findByText('Mollie payment methods').should('exist');
56+
cy.findByText('Content will follow...').should('not.exist');
57+
cy.get('[data-testid="no-data-notification"]').should('exist');
1658
});
1759
});

0 commit comments

Comments
 (0)