Skip to content

Commit

Permalink
Merge pull request #77 from mollie/feature/MOL-439/PICT-253_resolved-…
Browse files Browse the repository at this point in the history
…develop

Feature/mol 439/pict 253 resolved develop
  • Loading branch information
tdang1-shopmacher authored Oct 14, 2024
2 parents d495beb + 930c971 commit cfee8db
Show file tree
Hide file tree
Showing 23 changed files with 1,074 additions and 101 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,35 @@ Added

- Mollie custom application initialization

Updated

- [getPaymentMethods](/docs/GetPaymentMethods.md) response has new returned format as follow

```Typescript
{
id: string,
name: Record<string, string>
description: Record<string, string>
image: string;
order: number;
}

// e.g.
{
id: 'paypal',
name: {
'en-GB': 'PayPal',
'de-DE': 'PayPal',
},
description: {
'en-GB': '',
'de-DE': '',
},
image: 'https://example.img/paypal.svg',
order: 1
}
```

## v1.1.2

Added
Expand Down
2 changes: 1 addition & 1 deletion application/custom-application-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config = {
cloudIdentifier: CLOUD_IDENTIFIER,
env: {
development: {
initialProjectKey: 'shopm-adv-dev',
initialProjectKey: 'shopm-adv-windev',
},
production: {
applicationId: CUSTOM_APPLICATION_ID,
Expand Down
1 change: 1 addition & 0 deletions application/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default defineConfig({
LOGIN_PASSWORD: process.env.CYPRESS_LOGIN_PASSWORD,
PROJECT_KEY: process.env.CYPRESS_PROJECT_KEY,
PACKAGE_NAME: process.env.CYPRESS_PACKAGE_NAME,
LOCALE: process.env.CYPRESS_LOCALE || 'en-GB',
},
};
},
Expand Down
3 changes: 2 additions & 1 deletion application/cypress/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ CYPRESS_LOGIN_USER=<your-user>
CYPRESS_LOGIN_PASSWORD=<your-password>
CYPRESS_PROJECT_KEY=<your-project-key>
CYPRESS_PACKAGE_NAME="application"
CYPRESS_BASE_URL="https://mc.europe-west1.gcp.commercetools.com/"
CYPRESS_BASE_URL="https://mc.europe-west1.gcp.commercetools.com/"
CYPRESS_LOCALE="en-GB"
60 changes: 60 additions & 0 deletions application/cypress/e2e/method-details.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/// <reference types="cypress" />
/// <reference types="@testing-library/cypress" />
/// <reference types="@commercetools-frontend/cypress" />

import {
entryPointUriPath,
APPLICATION_BASE_ROUTE,
} from '../support/constants';
beforeEach(() => {
cy.loginToMerchantCenter({
entryPointUriPath,
initialRoute: APPLICATION_BASE_ROUTE,
});

cy.fixture('forward-to').then((response) => {
cy.intercept('GET', '/proxy/forward-to', {
statusCode: 200,
body: response,
});
});
});

describe('Test welcome.cy.ts', () => {
it('should render method details page', () => {
const LOCALE = Cypress.env('LOCALE');
const paymentMethods = [
'PayPal',
'iDEAL Pay in 3 instalments, 0% interest',
'iDEAL',
'Bancontact',
'Blik',
];

cy.findByText(paymentMethods[0]).click();
cy.url().should('contain', 'general');

cy.findByTestId('status-select').should('exist');

cy.findByTestId(`name-input-${LOCALE}`).should('exist');
cy.findByTestId(`description-input-${LOCALE}`).should('exist');
cy.findByTestId(`display-order-input`).should('exist');
});

it('should update display order successfully', () => {
const paymentMethodIds = ['paypal', 'ideal', 'bancontact'];

cy.findByTestId(`display-order-column-${paymentMethodIds[0]}`).click();
cy.url().should('contain', 'general');

cy.findByTestId(`display-order-input`).should('exist');
cy.findByTestId(`display-order-input`).clear();
cy.findByTestId(`display-order-input`).type('20');
cy.findByTestId(`save-button`).click();
cy.findByLabelText('Go back').click();
cy.findByTestId(`display-order-column-${paymentMethodIds[0]}`).should(
'have.text',
20
);
});
});
Loading

0 comments on commit cfee8db

Please sign in to comment.