Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(atomic): styling smoke tests #4978

Open
wants to merge 1 commit into
base: KIT-3925
Choose a base branch
from
Open

test(atomic): styling smoke tests #4978

wants to merge 1 commit into from

Conversation

fpbrault
Copy link
Contributor

This PR adds tests to ensure our components styles can be customized using our --atomic-* css variables. Tests to verify that our styles dont escape our components have also been added.

https://coveord.atlassian.net/browse/KIT-3966
https://coveord.atlassian.net/browse/KIT-3965

Copy link

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 244.2 244.2 0
commerce 355.5 355.5 0
search 415.5 415.5 0
insight 406.7 406.7 0
recommendation 256.3 256.3 0
ssr 409.3 409.3 0
ssr-commerce 373.2 373.2 0

@fpbrault fpbrault marked this pull request as ready for review February 18, 2025 22:13
@fpbrault fpbrault requested a review from a team as a code owner February 18, 2025 22:13
@fpbrault fpbrault force-pushed the KIT-3966 branch 2 times, most recently from f08466d to a280fab Compare February 18, 2025 22:40
@fpbrault fpbrault requested review from a team as code owners February 19, 2025 21:29
Comment on lines +52 to +70
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
Copy link
Contributor

Choose a reason for hiding this comment

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

The switch is to comment and uncomment parts of the config ?
We cannot do more elegant and practical than this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as atomic-hosted-page, this is directly from the playwright config examples:

https://github.com/microsoft/playwright/blob/main/examples/todomvc/playwright.config.ts

Comment on lines +29 to +47
// Add/modify a translation
// searchInterface.i18n.addResourceBundle('en', 'translation', {
// search: 'Make me feel lucky!'
// });

// Change the language of the interface dynamically
// searchInterface.language = 'fr';

// Interact with the engine
// searchInterface.engine.dispatch(...);

// Get all translated strings for a language/namespace
// const allStrings = searchInterface.i18n.getResourceBundle('en', 'translation');

// Add field value captions, using caption-[field]
// searchInterface.i18n.addResourceBundle('en', 'caption-author', {
// 'BBC News': 'The BBC',
// amoreau: 'Alexandre Moreau',
// });
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this another switch ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is what we have in the main example page (index.html), themingTests.html is a duplicate of it with the only difference being a custom theme applied

@dmgauthier
Copy link
Contributor

I wonder if proper playwright visual testing https://playwright.dev/docs/test-snapshots
could have been leveraged instead of reliying on the implementation.

@fpbrault
Copy link
Contributor Author

I wonder if proper playwright visual testing https://playwright.dev/docs/test-snapshots could have been leveraged instead of reliying on the implementation.

@dmgauthier not sure how this would let us test that the colors of the variables are getting applied to the components

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.

2 participants