Skip to content

Commit

Permalink
[MM-30969] Drop aria-label from Marketplace item description (matterm…
Browse files Browse the repository at this point in the history
…ost#7133)

* Drop aria-label from Marketplace item description

* Add general aria-label
  • Loading branch information
hanzei committed Dec 7, 2020
1 parent e6d400c commit 01b80ca
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports[`components/MarketplaceItem MarketplaceItem should render 1`] = `
</span>
</a>
<a
aria-label="test plugin"
aria-label="Plugin's website"
className="style--none more-modal__row--link"
href="http://example.com"
rel="noopener noreferrer"
Expand Down Expand Up @@ -114,7 +114,7 @@ exports[`components/MarketplaceItem MarketplaceItem should render installed plug
</span>
</a>
<a
aria-label="test plugin"
aria-label="Plugin's website"
className="style--none more-modal__row--link"
href="http://example.com"
rel="noopener noreferrer"
Expand Down Expand Up @@ -194,7 +194,7 @@ exports[`components/MarketplaceItem MarketplaceItem should render when not from
</span>
</a>
<a
aria-label="test plugin"
aria-label="Plugin's website"
className="style--none more-modal__row--link"
href="http://example.com"
rel="noopener noreferrer"
Expand Down Expand Up @@ -276,7 +276,7 @@ exports[`components/MarketplaceItem MarketplaceItem should render with empty lis
</span>
</a>
<a
aria-label="test plugin"
aria-label="Plugin's website"
className="style--none more-modal__row--link"
href="http://example.com"
rel="noopener noreferrer"
Expand Down Expand Up @@ -326,6 +326,86 @@ exports[`components/MarketplaceItem MarketplaceItem should render with empty lis
</Fragment>
`;

exports[`components/MarketplaceItem MarketplaceItem should render with no plugin description 1`] = `
<Fragment>
<div
className="more-modal__row more-modal__row--link"
id="marketplace-plugin-id"
key="id"
>
<div
className="icon__plugin icon__plugin--background"
>
<img
src="icon"
/>
</div>
<div
className="more-modal__details"
>
<a
aria-label="name"
className="style--none more-modal__row--link"
href="http://example.com"
rel="noopener noreferrer"
target="_blank"
>
name
<span
className="light subtitle"
>
(1.0.0)
</span>
</a>
<a
aria-label="Plugin's website"
className="style--none more-modal__row--link"
href="http://example.com"
rel="noopener noreferrer"
target="_blank"
>
<p
className="more-modal__description"
/>
</a>
<UpdateDetails
installedVersion=""
isInstalling={false}
onUpdate={[Function]}
version="1.0.0"
/>
</div>
<div
className="more-modal__actions"
>
<button
className="btn btn-primary"
disabled={false}
onClick={[Function]}
>
<LoadingWrapper
loading={false}
text="Installing..."
>
<FormattedMessage
defaultMessage="Install"
id="marketplace_modal.list.Install"
/>
</LoadingWrapper>
</button>
</div>
<UpdateConfirmationModal
installedVersion=""
name="name"
onCancel={[Function]}
onUpdate={[Function]}
show={false}
version="1.0.0"
/>
</div>
</Fragment>
`;

exports[`components/MarketplaceItem MarketplaceItem should render with no plugin icon 1`] = `
<Fragment>
<div
Expand Down Expand Up @@ -354,7 +434,7 @@ exports[`components/MarketplaceItem MarketplaceItem should render with no plugin
</span>
</a>
<a
aria-label="test plugin"
aria-label="Plugin's website"
className="style--none more-modal__row--link"
href="http://example.com"
rel="noopener noreferrer"
Expand Down Expand Up @@ -442,7 +522,7 @@ exports[`components/MarketplaceItem MarketplaceItem should render with one label
url="http://example.com/info"
/>
<a
aria-label="test plugin"
aria-label="Plugin's website"
className="style--none more-modal__row--link"
href="http://example.com"
rel="noopener noreferrer"
Expand Down Expand Up @@ -524,7 +604,7 @@ exports[`components/MarketplaceItem MarketplaceItem should render with server er
</span>
</a>
<a
aria-label="test plugin"
aria-label="Plugin's website"
className="style--none more-modal__row--link"
href="http://example.com"
rel="noopener noreferrer"
Expand Down Expand Up @@ -618,7 +698,7 @@ exports[`components/MarketplaceItem MarketplaceItem should render with two label
url="http://example.com/info2"
/>
<a
aria-label="test plugin"
aria-label="Plugin's website"
className="style--none more-modal__row--link"
href="http://example.com"
rel="noopener noreferrer"
Expand Down Expand Up @@ -700,7 +780,7 @@ exports[`components/MarketplaceItem MarketplaceItem should render with update an
</span>
</a>
<a
aria-label="test plugin"
aria-label="Plugin's website"
className="style--none more-modal__row--link"
href="http://example.com"
rel="noopener noreferrer"
Expand Down Expand Up @@ -782,7 +862,7 @@ exports[`components/MarketplaceItem MarketplaceItem should render with update av
</span>
</a>
<a
aria-label="test plugin"
aria-label="Plugin's website"
className="style--none more-modal__row--link"
href="http://example.com"
rel="noopener noreferrer"
Expand Down Expand Up @@ -859,7 +939,7 @@ exports[`components/MarketplaceItem MarketplaceItem should render wtih no homepa
</span>
</span>
<span
aria-label="test plugin"
aria-label="Plugin\\\\'s website"
className="style--none"
>
<p
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export default class MarketplaceItem extends React.PureComponent {
static propTypes = {
id: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
description: PropTypes.string,
version: PropTypes.string.isRequired,
homepageUrl: PropTypes.string,
releaseNotesUrl: PropTypes.string,
Expand Down Expand Up @@ -443,7 +443,7 @@ export default class MarketplaceItem extends React.PureComponent {
</a>
{labels}
<a
aria-label={this.props.description.toLowerCase()}
aria-label="Plugin's website"
className='style--none more-modal__row--link'
target='_blank'
rel='noopener noreferrer'
Expand All @@ -464,7 +464,7 @@ export default class MarketplaceItem extends React.PureComponent {
</span>
{labels}
<span
aria-label={this.props.description.toLowerCase()}
aria-label="Plugin\'s website"
className='style--none'
>
{description}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,17 @@ describe('components/MarketplaceItem', () => {
expect(wrapper).toMatchSnapshot();
});

test('should render with no plugin description', () => {
const props = {...baseProps};
delete props.description;

const wrapper = shallow(
<MarketplaceItem {...props}/>,
);

expect(wrapper).toMatchSnapshot();
});

test('should render with no plugin icon', () => {
const props = {...baseProps};
delete props.iconData;
Expand Down

0 comments on commit 01b80ca

Please sign in to comment.