@@ -52,6 +52,38 @@ describe('icons', () => {
52
52
expect ( wrapper . find ( 'svg > g > path' ) . exists ( ) ) . toBe ( true )
53
53
} )
54
54
55
+ it ( 'b-icon has expected structure when `stacked` prop is true' , async ( ) => {
56
+ const wrapper = mount ( BIcon , {
57
+ localVue : localVue ,
58
+ parentComponent : parentComponent ,
59
+ propsData : {
60
+ icon : 'alert-circle-fill' ,
61
+ stacked : true
62
+ }
63
+ } )
64
+
65
+ expect ( wrapper . exists ( ) ) . toBe ( true )
66
+ expect ( wrapper . is ( 'svg' ) ) . toBe ( true )
67
+ expect ( wrapper . classes ( ) ) . toContain ( 'b-icon' )
68
+ expect ( wrapper . classes ( ) ) . toContain ( 'bi' )
69
+ expect ( wrapper . classes ( ) ) . toContain ( 'bi-alert-circle-fill' )
70
+ expect ( wrapper . classes ( ) . length ) . toBe ( 3 )
71
+ expect ( wrapper . attributes ( 'role' ) ) . not . toBe ( 'img' )
72
+ expect ( wrapper . attributes ( 'alt' ) ) . not . toBe ( 'icon' )
73
+ expect ( wrapper . attributes ( 'focusable' ) ) . toBe ( 'false' )
74
+ expect ( wrapper . attributes ( 'xmlns' ) ) . not . toBe ( 'http://www.w3.org/2000/svg' )
75
+ expect ( wrapper . attributes ( 'width' ) ) . not . toBe ( '1em' )
76
+ expect ( wrapper . attributes ( 'height' ) ) . not . toBe ( '1em' )
77
+ expect ( wrapper . attributes ( 'viewBox' ) ) . toBe ( '0 0 20 20' )
78
+ expect ( wrapper . attributes ( 'fill' ) ) . toBe ( 'currentColor' )
79
+ expect ( wrapper . attributes ( 'style' ) ) . not . toBeDefined ( )
80
+ expect ( wrapper . element . style . fontSize ) . toEqual ( '' )
81
+ expect ( wrapper . find ( 'svg > g' ) . exists ( ) ) . toBe ( true )
82
+ expect ( wrapper . find ( 'svg > g' ) . attributes ( 'transform' ) ) . not . toBeDefined ( )
83
+ expect ( wrapper . find ( 'svg > g > path' ) . exists ( ) ) . toBe ( false )
84
+ expect ( wrapper . find ( 'svg > g > g > path' ) . exists ( ) ) . toBe ( true )
85
+ } )
86
+
55
87
it ( 'b-icon with empty icon name renders BIconBlank' , async ( ) => {
56
88
// This test assumes Vue doesn't puke on unknown component names
57
89
// As we don't specify a parent instance (which has all the registered
0 commit comments