Skip to content
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

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open

Conversation

robmadole
Copy link
Member

No description provided.

@@ -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()
Copy link
Member

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) {
Copy link
Member

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 ?

Copy link
Member

@jasonlundien jasonlundien left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants