Skip to content

Conversation

@johnayeni
Copy link
Contributor

📋 Pull Request Checklist

  • I have added unit tests to cover my changes.
  • I have added or updated Storybook stories where applicable.
  • I have tested the changes manually in the local environment.
  • I have checked that no PII data is being sent on analytics events
  • All E2E tests are passing, and I have added new tests if necessary.
  • All interfaces and types introduced or updated are strictly typed.

📝 Summary


🧪 Tested scenarios


🔗 Related GitHub Issue / Internal Ticket number

Closes:


@changeset-bot
Copy link

changeset-bot bot commented Dec 24, 2025

⚠️ No Changeset found

Latest commit: 8512249

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Dec 24, 2025

Deploy Preview for adyen-web ready!

Name Link
🔨 Latest commit 8512249
🔍 Latest deploy log https://app.netlify.com/projects/adyen-web/deploys/694c28ccb8d7940008cf85c9
😎 Deploy Preview https://deploy-preview-3734.checkout-web-dev.adyen.com
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @johnayeni, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the project's end-to-end testing infrastructure by integrating automated visual regression testing using Playwright. It introduces new configurations and scripts to manage visual tests, refactors existing test setups, and enhances Storybook components with test-specific attributes and loading indicators. The goal is to improve the reliability of UI changes and expand test coverage for various payment method states.

Highlights

  • Playwright Configuration Refactor: The Playwright test configurations have been refactored, moving from a single automated-a11y.config.ts to a more modular structure with automated-ally.playwright.config.ts and automated-visual.playwright.config.ts. The main playwright.config.ts now includes shared screenshot configuration and a more generic exclusion pattern for automated tests.
  • Automated Visual Testing: New Playwright scripts and a dedicated configuration (automated-visual.playwright.config.ts) have been introduced to enable automated visual regression testing. A new test file (visual.spec.ts) dynamically generates visual tests for Storybook components, capturing screenshots and performing comparisons.
  • New Yarn Scripts for Testing: Several new yarn scripts have been added to package.json and packages/e2e-playwright/package.json to support the new visual testing capabilities, including test:e2e:update-screenshots, test:automated-visual, and test:automated-visual:update-screenshots.
  • Storybook Component Enhancements: Various Storybook components (Card, CustomCard, Donation, Giftcard) have been updated to include data-testid attributes for better testability and to display a Spinner component while loading, improving the visual feedback during automated tests.
  • New Storybook Stories for Payment Methods: New Storybook stories have been added for Econtext, MBWay, Oxxo, Pix, and Swish to cover specific states like voucher screens and await screens, utilizing msw for mocking API responses where necessary.
  • Font Update in Storybook: The default font in the Storybook environment has been updated from system fonts to 'Inter, sans-serif', imported from Google Fonts, providing a consistent visual experience.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/automated-visual.yml
    • .github/workflows/update-screenshots.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces visual regression testing using Playwright screenshots. It includes new configurations for visual tests, scripts to run them, and updates to Storybook components to facilitate testing by adding data-testid attributes and handling loading states. My review focuses on improving the maintainability of the test filtering logic and addressing some TypeScript typing inconsistencies in the new stories. Overall, this is a great step towards improving UI consistency and quality.

Comment on lines +29 to +43
const storyIds = allEntries
.filter(
entry =>
entry.type === 'story' &&
!entry.id.includes('dropin') &&
!entry.id.includes('internal') &&
!entry.id.includes('applepay') &&
!entry.id.includes('amazonpay') &&
!entry.id.includes('paybybankpix') &&
!entry.id.includes('clicktopay') &&
!entry.id.includes('paypal--express') &&
!entry.id.includes('fastlane--lookup') &&
!entry.id.includes('components-cards--card-with-3-ds-2-create-from-action') &&
!entry.id.includes('helpers')
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current method of filtering stories to exclude from visual tests is a bit brittle as it relies on string matching against story IDs. If stories are renamed or moved, these filters might break silently.
A more robust and declarative approach would be to use Storybook tags. You could add a specific tag (e.g., 'no-visual-test') to the stories you want to exclude in their .stories.tsx file.

For example, in a story file:

export const MyStory: Story = {
  // ...
  tags: ['no-visual-test'],
};

Then, you could simplify the filtering logic here to:

const storyIds = allEntries
    .filter(
        entry =>
            entry.type === 'story' &&
            !entry.tags.includes('no-visual-test')
    )
    .map(entry => entry.id);

This would make the exclusion criteria more explicit and easier to manage directly from the story files.

Comment on lines +38 to +39
// @ts-expect-error instructionsUrl is not defined in VoucherConfiguration
instructionsUrl: 'https://example.com/instructions',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using @ts-expect-error here indicates a potential mismatch in types. The Econtext component is instantiated with props that are not defined in its EcontextConfiguration type, specifically instructionsUrl.

While @ts-expect-error works, a better long-term solution would be to improve the typings. You could create a more specific configuration type for Econtext that includes the properties for the voucher result view.

For example, you could define EcontextConfiguration to include these optional properties:

// in packages/lib/src/components/Econtext/types.ts
export interface EcontextConfiguration extends PersonalDetailsConfiguration, VoucherConfiguration {
    instructionsUrl?: string;
    collectionInstitutionNumber?: string;
    maskedTelephoneNumber?: string;
    expiresAt?: string;
}

This would make the component's props type-safe and remove the need for @ts-expect-error. A similar issue exists in Oxxo.stories.tsx.

Comment on lines +34 to +35
// @ts-expect-error merchantReference is not defined in VoucherConfiguration
merchantReference: 'testmerchantreference',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The use of @ts-expect-error suggests a typing issue. The Oxxo component is instantiated with merchantReference which is not part of VoucherConfiguration.

To improve type safety and remove the need for this comment, you could define a specific OxxoConfiguration type that extends VoucherConfiguration with the additional properties needed for the voucher result.

For example, in a new packages/lib/src/components/Oxxo/types.ts:

import { VoucherConfiguration, VoucherResultProps } from '../types';

export interface OxxoConfiguration extends VoucherConfiguration, Pick<VoucherResultProps, 'merchantReference' | 'alternativeReference' | 'downloadUrl' | 'expiresAt'> {}

Then, you would update Oxxo.tsx to use UIElement<OxxoConfiguration> and this story to use StoryConfiguration<OxxoConfiguration>. This would provide better type checking and autocompletion.

@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2025

size-limit report 📦

Path Size
UMD 113.88 KB (-0.03% 🔽)
Auto 120.18 KB (-0.03% 🔽)
ESM - Core 25.45 KB (0%)
ESM - Core + Card 64.68 KB (0%)
ESM - Core + Dropin with Card 71.27 KB (0%)

@johnayeni
Copy link
Contributor Author

/screenshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant