Skip to content

Commit

Permalink
fix trailing visual as text + add test
Browse files Browse the repository at this point in the history
  • Loading branch information
langermank committed Dec 18, 2024
1 parent e91e3ff commit a4b11b0
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
28 changes: 28 additions & 0 deletions e2e/components/ActionList.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -773,4 +773,32 @@ test.describe('ActionList', () => {
})
}
})

test.describe('Link Item Options', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-actionlist-examples--list-link-item',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`Link Item Options.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'components-actionlist-examples--list-link-item',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations()
})
})
}
})
})
14 changes: 13 additions & 1 deletion packages/react/src/ActionList/ActionList.examples.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,21 @@ export const ListLinkItem = () => (
<ActionList.LeadingVisual>
<LinkIcon />
</ActionList.LeadingVisual>
ActionList.LinkItem with everything
With inline description
<ActionList.Description variant="inline">inline description</ActionList.Description>
</ActionList.LinkItem>
<ActionList.LinkItem href="?path=/story/components-actionlist--default">
<ActionList.LeadingVisual>
<LinkIcon />
</ActionList.LeadingVisual>
With block description
<ActionList.Description variant="block">Block description</ActionList.Description>
</ActionList.LinkItem>
<ActionList.LinkItem href="?path=/story/components-actionlist--default">
<ActionList.LeadingVisual>
<LinkIcon />
</ActionList.LeadingVisual>
Trailing visual
<ActionList.TrailingVisual>⌘ + L</ActionList.TrailingVisual>
</ActionList.LinkItem>
</ActionList>
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/ActionList/ActionList.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ default block */
span wrapping svg or text */
.VisualWrap {
display: flex;
min-width: max-content;
min-height: var(--control-medium-lineBoxHeight);
/* stylelint-disable-next-line primer/typography */
line-height: 20px; /* temporary until we fix line-height rounding in primitives */
Expand Down

0 comments on commit a4b11b0

Please sign in to comment.