@@ -37,7 +37,7 @@ export function runHarnessTests(
3737
3838 it ( 'should load all icon harnesses' , async ( ) => {
3939 const icons = await loader . getAllHarnesses ( iconHarness ) ;
40- expect ( icons . length ) . toBe ( 4 ) ;
40+ expect ( icons . length ) . toBe ( 6 ) ;
4141 } ) ;
4242
4343 it ( 'should filter icon harnesses based on their type' , async ( ) => {
@@ -47,7 +47,7 @@ export function runHarnessTests(
4747 ] ) ;
4848
4949 expect ( svgIcons . length ) . toBe ( 1 ) ;
50- expect ( fontIcons . length ) . toBe ( 3 ) ;
50+ expect ( fontIcons . length ) . toBe ( 5 ) ;
5151 } ) ;
5252
5353 it ( 'should filter icon harnesses based on their name' , async ( ) => {
@@ -69,31 +69,45 @@ export function runHarnessTests(
6969
7070 expect ( regexFilterResults . length ) . toBe ( 1 ) ;
7171 expect ( stringFilterResults . length ) . toBe ( 1 ) ;
72- expect ( nullFilterResults . length ) . toBe ( 2 ) ;
72+ expect ( nullFilterResults . length ) . toBe ( 4 ) ;
7373 } ) ;
7474
7575 it ( 'should get the type of each icon' , async ( ) => {
7676 const icons = await loader . getAllHarnesses ( iconHarness ) ;
7777 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+ ] ) ;
7986 } ) ;
8087
8188 it ( 'should get the name of an icon' , async ( ) => {
8289 const icons = await loader . getAllHarnesses ( iconHarness ) ;
8390 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+ ] ) ;
8599 } ) ;
86100
87101 it ( 'should get the namespace of an icon' , async ( ) => {
88102 const icons = await loader . getAllHarnesses ( iconHarness ) ;
89103 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 ] ) ;
91105 } ) ;
92106
93107 it ( 'should get whether an icon is inline' , async ( ) => {
94108 const icons = await loader . getAllHarnesses ( iconHarness ) ;
95109 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 ] ) ;
97111 } ) ;
98112}
99113
@@ -103,6 +117,8 @@ export function runHarnessTests(
103117 <mat-icon svgIcon="svgIcons:svgIcon"></mat-icon>
104118 <mat-icon inline>ligature_icon</mat-icon>
105119 <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>
106122 ` ,
107123} )
108124class IconHarnessTest { }
0 commit comments