Skip to content

Commit

Permalink
Fix linting errors in AdditionalInfo and HttpService.spec files
Browse files Browse the repository at this point in the history
  • Loading branch information
elmiomar committed Oct 15, 2024
1 parent a2398e5 commit e717761
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const AdditionalInfo: React.FC<AdditionalInfoProps> = ({ id, termsOfServi
: license?.identifier
? `https://spdx.org/licenses/${license?.identifier}.html`
: undefined;

const licenseLink =
license?.name && licenseUrl
? `[${license.name}](${licenseUrl})`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,29 +273,29 @@ describe('HttpService', () => {
email: '[email protected]',
url: 'https://stoplight.io/contact-us/',
};

const license = {
name: 'MIT License',
identifier: 'MIT',
};

render(
<AdditionalInfo id="a" contact={contact} license={license} termsOfService="https://stoplight.io/terms/" />,
);

const licenseLink = screen.getByText('MIT License');
expect(licenseLink).toHaveAttribute('href', 'https://spdx.org/licenses/MIT.html');
});

it('should prefer license URL over SPDX identifier if both are provided', () => {
const license = {
name: 'MIT License',
url: 'https://opensource.org/licenses/MIT',
identifier: 'MIT',
};

render(<AdditionalInfo id="a" license={license} />);

const licenseLink = screen.getByText('MIT License');
expect(licenseLink).toHaveAttribute('href', 'https://opensource.org/licenses/MIT');
});
Expand Down

0 comments on commit e717761

Please sign in to comment.