-
Notifications
You must be signed in to change notification settings - Fork 13.4k
fix(item-divider): set padding-end for md #27019
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
Conversation
|
|
|
The code fix looks good, but I am wondering if we should simplify the item divider tests so it is just a screenshot of the item divider itself instead of an entire page. Thoughts, @liamdebeasi? |
|
I think that's a good idea. Smaller screenshots make it easier to identify what changed and will speed up test runs. |
|
@mapsandapps Can you update the item divider tests to add screenshots of only the divider? We can do something like this:
import { expect } from '@playwright/test';
import { test } from '@utils/test/playwright';
test.describe('item-divider: basic', () => {
test('should display an item divider with text', async ({ page, skip }) => {
await page.setContent(`
<ion-item-divider>
<ion-label>Item Divider</ion-label>
</ion-item-divider>
`);
const divider = page.locator('ion-item-divider');
await expect(divider).toHaveScreenshot(`item-divider-text-${page.getSnapshotSettings()}.png`);
});
test('should display an item divider with a button in the end slot', async ({ page, skip }) => {
await page.setContent(`
<ion-item-divider>
<ion-label>Item Divider</ion-label>
<ion-button slot="end">Button</ion-button>
</ion-item-divider>
`);
const divider = page.locator('ion-item-divider');
await expect(divider).toHaveScreenshot(`item-divider-button-end-${page.getSnapshotSettings()}.png`);
});
test('should display an item divider with an icon in the start slot', async ({ page, skip }) => {
await page.setContent(`
<ion-item-divider>
<ion-icon slot="start" name="star"></ion-icon>
<ion-label>Item Divider</ion-label>
</ion-item-divider>
`);
const divider = page.locator('ion-item-divider');
await expect(divider).toHaveScreenshot(`item-divider-icon-start-${page.getSnapshotSettings()}.png`);
});
});Feel free to modify these tests or add more, I was just thinking of some coverage we could have for both slots. You would then need to revert the addition to the spec test and ionitron's commit to update the reference screenshots. Please let me or Liam know if you have questions! |
| test.describe('item-divider: spec', () => { | ||
| test.beforeEach(async ({ page }) => { | ||
| await page.goto('/src/components/item-divider/test/spec'); | ||
| test.describe('item-divider: basic', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I meant put this test in its own file in a directory named basic:
core/src/components/item-divider/test/basic/item-divider.e2e.ts
Then revert the test in the spec/ folder to match main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, cool. from what y'all were saying i thought you wanted smaller tests, but this way there are more tests. is that ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think the spec test is needed to be taken as a whole page screenshot in order to check how the divider lines up with the items, we can revisit this when we change the test generator unless we want to strip the spec test to just a couple item dividers + items now.
|
Can you revert the file changes to the git checkout origin/main src/components/item-divider/test/spec/item-divider.e2e.ts-snapshots/I had to do that on another PR because reverting the commit didn't work. After that you'll want to run the update reference screenshots action on your branch to generate the new basic item divider screenshots. |
Pull request checklist
Please check if your PR fulfills the following requirements:
ionic-docsrepo, in a separate PR. See the contributing guide for details.npm run build) was run locally and any changes were pushednpm run lint) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
item-divider has padding on mode
iosbut not onmdIssue URL: #23785
What is the new behavior?
iosandmdDoes this introduce a breaking change?
Other information