Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions static/app/components/onboarding/scm/scmProviderPills.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ describe('ScmProviderPills', () => {
/>
);

expect(screen.getByText('GitHub')).toBeInTheDocument();
expect(screen.getByText('GitLab')).toBeInTheDocument();
expect(screen.getByText('Bitbucket')).toBeInTheDocument();
expect(screen.getByRole('button', {name: 'Add GitHub'})).toHaveTextContent('GitHub');
expect(screen.getByRole('button', {name: 'Add GitLab'})).toHaveTextContent('GitLab');
expect(screen.getByRole('button', {name: 'Add Bitbucket'})).toHaveTextContent(
'Bitbucket'
);
expect(screen.queryByText('More')).not.toBeInTheDocument();
});

Expand Down Expand Up @@ -101,7 +103,7 @@ describe('ScmProviderPills', () => {
// Secondary providers are hidden behind the "More" dropdown
expect(screen.queryByText('Bitbucket Server')).not.toBeInTheDocument();

await userEvent.click(screen.getByRole('button', {name: 'More'}));
await userEvent.click(screen.getByRole('button', {name: 'More providers'}));

expect(
screen.getByRole('menuitemradio', {name: 'Bitbucket Server'})
Expand All @@ -127,7 +129,7 @@ describe('ScmProviderPills', () => {
/>
);

await userEvent.click(screen.getByRole('button', {name: 'More'}));
await userEvent.click(screen.getByRole('button', {name: 'More providers'}));
await userEvent.click(screen.getByRole('menuitemradio', {name: 'GitHub Enterprise'}));

expect(openPipelineModalSpy).toHaveBeenCalledTimes(1);
Expand All @@ -147,7 +149,7 @@ describe('ScmProviderPills', () => {
/>
);

await userEvent.click(screen.getByRole('button', {name: 'More'}));
await userEvent.click(screen.getByRole('button', {name: 'More providers'}));
await userEvent.click(screen.getByRole('menuitemradio', {name: 'GitHub Enterprise'}));

expect(trackSpy).toHaveBeenCalledWith(
Expand All @@ -170,7 +172,7 @@ describe('ScmProviderPills', () => {
/>
);

await userEvent.click(screen.getByRole('button', {name: 'More'}));
await userEvent.click(screen.getByRole('button', {name: 'More providers'}));
await userEvent.click(screen.getByRole('menuitemradio', {name: 'GitHub Enterprise'}));

expect(trackSpy).toHaveBeenCalledWith(
Expand Down
4 changes: 4 additions & 0 deletions static/app/components/onboarding/scm/scmProviderPills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ function ScmProviderPillRow({
size: buttonSize,
icon: getIntegrationIcon(provider.key, iconSize),
buttonText: provider.name,
// AddIntegrationButton names every instance "Add integration";
// name each pill by its provider instead.
'aria-label': t('Add %s', provider.name),
}}
/>
</IntegrationContext>
))}
{moreProviders.length > 0 && (
<DropdownMenu
triggerLabel={t('More')}
triggerProps={{'aria-label': t('More providers')}}
position="bottom-end"
size={buttonSize}
items={moreProviders.map(provider => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export function AddIntegrationButton({
>
<Button
disabled={!provider.canAdd}
aria-label={t('Add integration')}
{...buttonProps}
onClick={() => {
if (label === t('Reinstall')) {
Expand All @@ -79,7 +80,6 @@ export function AddIntegrationButton({
onError,
});
}}
aria-label={t('Add integration')}
>
{label}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ type Props = {
*/
buttonProps: Pick<
React.ComponentProps<typeof AddIntegrationButton>,
'size' | 'variant' | 'disabled' | 'style' | 'data-test-id' | 'icon' | 'buttonText'
| 'size'
| 'variant'
| 'disabled'
| 'style'
| 'data-test-id'
| 'icon'
| 'buttonText'
| 'aria-label'
>;
onAddIntegration: (integration: Integration) => void;
onExternalClick: () => void;
Comment thread
sentry[bot] marked this conversation as resolved.
Expand Down
Loading