Skip to content

Commit

Permalink
Merge pull request #3105 from afebbraro/react-link-hotfix
Browse files Browse the repository at this point in the history
React link hotfix
  • Loading branch information
Amber Febbraro authored Apr 24, 2020
2 parents 63f5461 + c2637ec commit 39aa1bb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sparkdesignsystem/spark-react",
"version": "1.5.0",
"version": "1.5.1",
"description": "A collection of Spark Design System components in React 16+",
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion react/src/base/links/SprkLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const SprkLink = (props) => {
'sprk-b-Link--simple': variant === 'simple',
'sprk-b-Link--plain': variant === 'plain',
'sprk-b-Link--disabled': variant === 'disabled',
'sprk-b-Link--simple sprk-b-Link--has-icon': variant === 'has-icon' || 'hasIcon',
'sprk-b-Link--simple sprk-b-Link--has-icon': variant === 'has-icon' || variant === 'hasIcon',
});

let link;
Expand Down
7 changes: 7 additions & 0 deletions react/src/base/links/SprkLink.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,24 @@ describe('SprkLink:', () => {
+ ' is not unstyled', () => {
const wrapper = shallow(<SprkLink />);
expect(wrapper.find('a.sprk-b-Link').length).toBe(1);
expect(wrapper.find('a').hasClass('sprk-b-Link--simple')).toBe(false);
expect(wrapper.find('a').hasClass('sprk-b-Link--has-icon')).toBe(false);
});

it('should display a link element without the sprk-b-Link class if the'
+ ' variant is unstyled', () => {
const wrapper = shallow(<SprkLink variant="unstyled" />);
expect(wrapper.find('a').hasClass('sprk-b-Link')).toBe(false);
expect(wrapper.find('a').hasClass('sprk-b-Link--simple')).toBe(false);
expect(wrapper.find('a').hasClass('sprk-b-Link--has-icon')).toBe(false);
});

it('should display a link element with correct classes when variant'
+ ' is simple', () => {
const wrapper = shallow(<SprkLink variant="simple" />);
expect(wrapper.find('a').hasClass('sprk-b-Link')).toBe(true);
expect(wrapper.find('a').hasClass('sprk-b-Link--simple')).toBe(true);
expect(wrapper.find('a').hasClass('sprk-b-Link--has-icon')).toBe(false);
});

it('should display a link element with correct classes when variant is '
Expand All @@ -46,6 +51,8 @@ describe('SprkLink:', () => {
const wrapper = shallow(<SprkLink variant="plain" />);
expect(wrapper.find('a').hasClass('sprk-b-Link')).toBe(true);
expect(wrapper.find('a').hasClass('sprk-b-Link--plain')).toBe(true);
expect(wrapper.find('a').hasClass('sprk-b-Link--simple')).toBe(false);
expect(wrapper.find('a').hasClass('sprk-b-Link--has-icon')).toBe(false);
});

it('should display a link element with correct classes when variant is'
Expand Down

0 comments on commit 39aa1bb

Please sign in to comment.