Skip to content

Commit a4b11b0

Browse files
committed
fix trailing visual as text + add test
1 parent e91e3ff commit a4b11b0

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

e2e/components/ActionList.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,4 +773,32 @@ test.describe('ActionList', () => {
773773
})
774774
}
775775
})
776+
777+
test.describe('Link Item Options', () => {
778+
for (const theme of themes) {
779+
test.describe(theme, () => {
780+
test('default @vrt', async ({page}) => {
781+
await visit(page, {
782+
id: 'components-actionlist-examples--list-link-item',
783+
globals: {
784+
colorScheme: theme,
785+
},
786+
})
787+
788+
// Default state
789+
expect(await page.screenshot()).toMatchSnapshot(`Link Item Options.${theme}.png`)
790+
})
791+
792+
test('axe @aat', async ({page}) => {
793+
await visit(page, {
794+
id: 'components-actionlist-examples--list-link-item',
795+
globals: {
796+
colorScheme: theme,
797+
},
798+
})
799+
await expect(page).toHaveNoViolations()
800+
})
801+
})
802+
}
803+
})
776804
})

packages/react/src/ActionList/ActionList.examples.stories.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,21 @@ export const ListLinkItem = () => (
9494
<ActionList.LeadingVisual>
9595
<LinkIcon />
9696
</ActionList.LeadingVisual>
97-
ActionList.LinkItem with everything
97+
With inline description
9898
<ActionList.Description variant="inline">inline description</ActionList.Description>
99+
</ActionList.LinkItem>
100+
<ActionList.LinkItem href="?path=/story/components-actionlist--default">
101+
<ActionList.LeadingVisual>
102+
<LinkIcon />
103+
</ActionList.LeadingVisual>
104+
With block description
99105
<ActionList.Description variant="block">Block description</ActionList.Description>
106+
</ActionList.LinkItem>
107+
<ActionList.LinkItem href="?path=/story/components-actionlist--default">
108+
<ActionList.LeadingVisual>
109+
<LinkIcon />
110+
</ActionList.LeadingVisual>
111+
Trailing visual
100112
<ActionList.TrailingVisual>⌘ + L</ActionList.TrailingVisual>
101113
</ActionList.LinkItem>
102114
</ActionList>

packages/react/src/ActionList/ActionList.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ default block */
584584
span wrapping svg or text */
585585
.VisualWrap {
586586
display: flex;
587+
min-width: max-content;
587588
min-height: var(--control-medium-lineBoxHeight);
588589
/* stylelint-disable-next-line primer/typography */
589590
line-height: 20px; /* temporary until we fix line-height rounding in primitives */

0 commit comments

Comments
 (0)