Skip to content

Commit cfee8db

Browse files
Merge pull request #77 from mollie/feature/MOL-439/PICT-253_resolved-develop
Feature/mol 439/pict 253 resolved develop
2 parents d495beb + 930c971 commit cfee8db

File tree

23 files changed

+1074
-101
lines changed

23 files changed

+1074
-101
lines changed

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,35 @@ Added
1010

1111
- Mollie custom application initialization
1212

13+
Updated
14+
15+
- [getPaymentMethods](/docs/GetPaymentMethods.md) response has new returned format as follow
16+
17+
```Typescript
18+
{
19+
id: string,
20+
name: Record<string, string>
21+
description: Record<string, string>
22+
image: string;
23+
order: number;
24+
}
25+
26+
// e.g.
27+
{
28+
id: 'paypal',
29+
name: {
30+
'en-GB': 'PayPal',
31+
'de-DE': 'PayPal',
32+
},
33+
description: {
34+
'en-GB': '',
35+
'de-DE': '',
36+
},
37+
image: 'https://example.img/paypal.svg',
38+
order: 1
39+
}
40+
```
41+
1342
## v1.1.2
1443

1544
Added

application/custom-application-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const config = {
1515
cloudIdentifier: CLOUD_IDENTIFIER,
1616
env: {
1717
development: {
18-
initialProjectKey: 'shopm-adv-dev',
18+
initialProjectKey: 'shopm-adv-windev',
1919
},
2020
production: {
2121
applicationId: CUSTOM_APPLICATION_ID,

application/cypress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default defineConfig({
2828
LOGIN_PASSWORD: process.env.CYPRESS_LOGIN_PASSWORD,
2929
PROJECT_KEY: process.env.CYPRESS_PROJECT_KEY,
3030
PACKAGE_NAME: process.env.CYPRESS_PACKAGE_NAME,
31+
LOCALE: process.env.CYPRESS_LOCALE || 'en-GB',
3132
},
3233
};
3334
},

application/cypress/.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ CYPRESS_LOGIN_USER=<your-user>
22
CYPRESS_LOGIN_PASSWORD=<your-password>
33
CYPRESS_PROJECT_KEY=<your-project-key>
44
CYPRESS_PACKAGE_NAME="application"
5-
CYPRESS_BASE_URL="https://mc.europe-west1.gcp.commercetools.com/"
5+
CYPRESS_BASE_URL="https://mc.europe-west1.gcp.commercetools.com/"
6+
CYPRESS_LOCALE="en-GB"
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/// <reference types="cypress" />
2+
/// <reference types="@testing-library/cypress" />
3+
/// <reference types="@commercetools-frontend/cypress" />
4+
5+
import {
6+
entryPointUriPath,
7+
APPLICATION_BASE_ROUTE,
8+
} from '../support/constants';
9+
beforeEach(() => {
10+
cy.loginToMerchantCenter({
11+
entryPointUriPath,
12+
initialRoute: APPLICATION_BASE_ROUTE,
13+
});
14+
15+
cy.fixture('forward-to').then((response) => {
16+
cy.intercept('GET', '/proxy/forward-to', {
17+
statusCode: 200,
18+
body: response,
19+
});
20+
});
21+
});
22+
23+
describe('Test welcome.cy.ts', () => {
24+
it('should render method details page', () => {
25+
const LOCALE = Cypress.env('LOCALE');
26+
const paymentMethods = [
27+
'PayPal',
28+
'iDEAL Pay in 3 instalments, 0% interest',
29+
'iDEAL',
30+
'Bancontact',
31+
'Blik',
32+
];
33+
34+
cy.findByText(paymentMethods[0]).click();
35+
cy.url().should('contain', 'general');
36+
37+
cy.findByTestId('status-select').should('exist');
38+
39+
cy.findByTestId(`name-input-${LOCALE}`).should('exist');
40+
cy.findByTestId(`description-input-${LOCALE}`).should('exist');
41+
cy.findByTestId(`display-order-input`).should('exist');
42+
});
43+
44+
it('should update display order successfully', () => {
45+
const paymentMethodIds = ['paypal', 'ideal', 'bancontact'];
46+
47+
cy.findByTestId(`display-order-column-${paymentMethodIds[0]}`).click();
48+
cy.url().should('contain', 'general');
49+
50+
cy.findByTestId(`display-order-input`).should('exist');
51+
cy.findByTestId(`display-order-input`).clear();
52+
cy.findByTestId(`display-order-input`).type('20');
53+
cy.findByTestId(`save-button`).click();
54+
cy.findByLabelText('Go back').click();
55+
cy.findByTestId(`display-order-column-${paymentMethodIds[0]}`).should(
56+
'have.text',
57+
20
58+
);
59+
});
60+
});

0 commit comments

Comments
 (0)