New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use parse only if not an icon object #327
base: 2.x
Are you sure you want to change the base?
Conversation
@@ -33,7 +37,7 @@ if(coreHasFeature(ICON_ALIASES)) { | |||
const vm = mountFromProps({ icon: ['fas', 'close'] }) | |||
|
|||
expect(vm.$el.tagName).toBe('svg') | |||
expect(vm.$el.classList.contains('fa-close')).toBeTruthy() | |||
expect(vm.$el.classList.contains('fa-xmark')).toBeTruthy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you want the fa-xmark
icon here?
In v6 xmark
is the name of the icon and close
is the alias.
If we keep the fa-mark
we will need to import it (line 4), and will probably want to change the test name; currently test is 'find a free-solid-svg-icon that is an alias'.
As of right now, the test mentioned on the previous line fails because xmark
has NOT been imported.
@@ -12,7 +18,7 @@ function normalizeIconArgs (icon) { | |||
return null | |||
} | |||
|
|||
if (typeof icon === 'object' && icon.prefix && icon.iconName) { | |||
if (icon && typeof icon === 'object' && icon.prefix && icon.iconName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that icon.icon
is the only difference here between current line 21 and line 9 change.
Would we ever not have an icon.icon
property?
I see that this property is the icon details, unicode, svg, etc. My only thought here is that this covers webfonts in the case of an icon not using an svg ... is this correct, so we want to return the icon even if NOT an svg ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of questions for clarification's sake on my part.
No description provided.