@@ -37,7 +37,7 @@ export function runHarnessTests(
37
37
38
38
it ( 'should load all icon harnesses' , async ( ) => {
39
39
const icons = await loader . getAllHarnesses ( iconHarness ) ;
40
- expect ( icons . length ) . toBe ( 4 ) ;
40
+ expect ( icons . length ) . toBe ( 6 ) ;
41
41
} ) ;
42
42
43
43
it ( 'should filter icon harnesses based on their type' , async ( ) => {
@@ -47,7 +47,7 @@ export function runHarnessTests(
47
47
] ) ;
48
48
49
49
expect ( svgIcons . length ) . toBe ( 1 ) ;
50
- expect ( fontIcons . length ) . toBe ( 3 ) ;
50
+ expect ( fontIcons . length ) . toBe ( 5 ) ;
51
51
} ) ;
52
52
53
53
it ( 'should filter icon harnesses based on their name' , async ( ) => {
@@ -69,31 +69,45 @@ export function runHarnessTests(
69
69
70
70
expect ( regexFilterResults . length ) . toBe ( 1 ) ;
71
71
expect ( stringFilterResults . length ) . toBe ( 1 ) ;
72
- expect ( nullFilterResults . length ) . toBe ( 2 ) ;
72
+ expect ( nullFilterResults . length ) . toBe ( 4 ) ;
73
73
} ) ;
74
74
75
75
it ( 'should get the type of each icon' , async ( ) => {
76
76
const icons = await loader . getAllHarnesses ( iconHarness ) ;
77
77
const types = await parallel ( ( ) => icons . map ( icon => icon . getType ( ) ) ) ;
78
- expect ( types ) . toEqual ( [ IconType . FONT , IconType . SVG , IconType . FONT , IconType . FONT ] ) ;
78
+ expect ( types ) . toEqual ( [
79
+ IconType . FONT ,
80
+ IconType . SVG ,
81
+ IconType . FONT ,
82
+ IconType . FONT ,
83
+ IconType . FONT ,
84
+ IconType . FONT ,
85
+ ] ) ;
79
86
} ) ;
80
87
81
88
it ( 'should get the name of an icon' , async ( ) => {
82
89
const icons = await loader . getAllHarnesses ( iconHarness ) ;
83
90
const names = await parallel ( ( ) => icons . map ( icon => icon . getName ( ) ) ) ;
84
- expect ( names ) . toEqual ( [ 'fontIcon' , 'svgIcon' , 'ligature_icon' , 'ligature_icon_by_attribute' ] ) ;
91
+ expect ( names ) . toEqual ( [
92
+ 'fontIcon' ,
93
+ 'svgIcon' ,
94
+ 'ligature_icon' ,
95
+ 'ligature_icon_by_attribute' ,
96
+ 'ligature_icon_with_additional_content' ,
97
+ 'ligature_icon_with_indirect_name' ,
98
+ ] ) ;
85
99
} ) ;
86
100
87
101
it ( 'should get the namespace of an icon' , async ( ) => {
88
102
const icons = await loader . getAllHarnesses ( iconHarness ) ;
89
103
const namespaces = await parallel ( ( ) => icons . map ( icon => icon . getNamespace ( ) ) ) ;
90
- expect ( namespaces ) . toEqual ( [ 'fontIcons' , 'svgIcons' , null , null ] ) ;
104
+ expect ( namespaces ) . toEqual ( [ 'fontIcons' , 'svgIcons' , null , null , null , null ] ) ;
91
105
} ) ;
92
106
93
107
it ( 'should get whether an icon is inline' , async ( ) => {
94
108
const icons = await loader . getAllHarnesses ( iconHarness ) ;
95
109
const inlineStates = await parallel ( ( ) => icons . map ( icon => icon . isInline ( ) ) ) ;
96
- expect ( inlineStates ) . toEqual ( [ false , false , true , false ] ) ;
110
+ expect ( inlineStates ) . toEqual ( [ false , false , true , false , false , false ] ) ;
97
111
} ) ;
98
112
}
99
113
@@ -103,6 +117,8 @@ export function runHarnessTests(
103
117
<mat-icon svgIcon="svgIcons:svgIcon"></mat-icon>
104
118
<mat-icon inline>ligature_icon</mat-icon>
105
119
<mat-icon fontIcon="ligature_icon_by_attribute"></mat-icon>
120
+ <mat-icon>ligature_icon_with_additional_content <span class="fake-badge">Hello</span></mat-icon>
121
+ <mat-icon><span>ligature_icon_with_indirect_name</span></mat-icon>
106
122
` ,
107
123
} )
108
124
class IconHarnessTest { }
0 commit comments