@@ -6,18 +6,50 @@ import Vue from 'vue/dist/vue'
66import FontAwesomeIcon from '../FontAwesomeIcon'
77import { library } from '@fortawesome/fontawesome-svg-core'
88import { faClose , faUser } from '@fortawesome/free-solid-svg-icons'
9- import { faCoffee , faCircle , faSpartan } from '../__fixtures__/icons'
10- import { coreHasFeature , REFERENCE_ICON_USING_STRING , REFERENCE_ICON_BY_STYLE , ICON_ALIASES , compileAndMount , mountFromProps } from '../__fixtures__/helpers'
9+ import { faCoffee , faCircle , faSpartan , faGlasses } from '../__fixtures__/icons'
10+ import { coreHasFeature , compileAndMount , mountFromProps , REFERENCE_ICON_BY_STYLE , ICON_ALIASES , REFERENCE_ICON_USING_STRING , REFERENCE_ICON_USING_FAMILY } from '../__fixtures__/helpers'
1111
1212beforeEach ( ( ) => {
13- library . add ( faCoffee , faCircle , faSpartan )
13+ library . add ( faCoffee , faCircle , faSpartan , faGlasses )
1414 Vue . component ( 'font-awesome-icon' , FontAwesomeIcon )
1515} )
1616
1717afterEach ( ( ) => {
1818 library . reset ( )
1919} )
2020
21+ describe ( 'using a family' , ( ) => {
22+ if ( coreHasFeature ( REFERENCE_ICON_USING_FAMILY ) ) {
23+ test ( 'will find a sharp-solid-svg-icon with array format' , ( ) => {
24+ const vm = mountFromProps ( { icon : [ 'fass' , 'glasses' ] } )
25+
26+ expect ( vm . $el . tagName ) . toBe ( 'svg' )
27+ expect ( vm . $el . classList . contains ( 'fa-glasses' ) ) . toBeTruthy ( )
28+ } )
29+
30+ test ( 'will find a sharp solid icon using short prefix with string format' , ( ) => {
31+ const vm = mountFromProps ( { icon : 'fass fa-glasses' } )
32+
33+ expect ( vm . $el . tagName ) . toBe ( 'svg' )
34+ expect ( vm . $el . classList . contains ( 'fa-glasses' ) ) . toBeTruthy ( )
35+ } )
36+
37+ test ( 'will find a sharp solid icon using long prefix with string format' , ( ) => {
38+ const vm = mountFromProps ( { icon : 'fa-sharp fa-glasses' } )
39+
40+ expect ( vm . $el . tagName ) . toBe ( 'svg' )
41+ expect ( vm . $el . classList . contains ( 'fa-glasses' ) ) . toBeTruthy ( )
42+ } )
43+
44+ test ( 'will find a sharp solid icon using long prefix and style with string format' , ( ) => {
45+ const vm = mountFromProps ( { icon : 'fa-sharp fa-solid fa-glasses' } )
46+
47+ expect ( vm . $el . tagName ) . toBe ( 'svg' )
48+ expect ( vm . $el . classList . contains ( 'fa-glasses' ) ) . toBeTruthy ( )
49+ } )
50+ }
51+ } )
52+
2153test ( 'using a FAT icon with array format' , ( ) => {
2254 const vm = mountFromProps ( { icon : [ 'fat' , 'spartan' ] } )
2355
0 commit comments