@@ -1450,32 +1450,47 @@ describe('MatInput with appearance', () => {
14501450} ) ;
14511451
14521452describe ( 'MatFormField default options' , ( ) => {
1453- it ( 'should be legacy appearance if no default options provided' , fakeAsync ( ( ) => {
1453+ it ( 'should be legacy appearance if no default options provided' , ( ) => {
14541454 const fixture = createComponent ( MatInputWithAppearance ) ;
14551455 fixture . detectChanges ( ) ;
1456- flush ( ) ;
14571456 expect ( fixture . componentInstance . formField . appearance ) . toBe ( 'legacy' ) ;
1458- } ) ) ;
1457+ } ) ;
14591458
1460- it ( 'should be legacy appearance if empty default options provided' , fakeAsync ( ( ) => {
1459+ it ( 'should be legacy appearance if empty default options provided' , ( ) => {
14611460 const fixture = createComponent ( MatInputWithAppearance , [ {
14621461 provide : MAT_FORM_FIELD_DEFAULT_OPTIONS , useValue : { } }
14631462 ] ) ;
14641463
14651464 fixture . detectChanges ( ) ;
1466- flush ( ) ;
14671465 expect ( fixture . componentInstance . formField . appearance ) . toBe ( 'legacy' ) ;
1468- } ) ) ;
1466+ } ) ;
1467+
1468+ it ( 'should be able to change the default appearance' , ( ) => {
1469+ const fixture = createComponent ( MatInputWithAppearance , [ {
1470+ provide : MAT_FORM_FIELD_DEFAULT_OPTIONS , useValue : { appearance : 'fill' } }
1471+ ] ) ;
1472+ fixture . detectChanges ( ) ;
1473+ expect ( fixture . componentInstance . formField . appearance ) . toBe ( 'fill' ) ;
1474+ } ) ;
1475+
1476+ it ( 'should default hideRequiredMarker to false' , ( ) => {
1477+ const fixture = createComponent ( MatInputWithAppearance , [ {
1478+ provide : MAT_FORM_FIELD_DEFAULT_OPTIONS , useValue : { } }
1479+ ] ) ;
1480+
1481+ fixture . detectChanges ( ) ;
1482+ expect ( fixture . componentInstance . formField . hideRequiredMarker ) . toBe ( false ) ;
1483+ } ) ;
1484+
1485+ it ( 'should be able to change the default value of hideRequiredMarker' , ( ) => {
1486+ const fixture = createComponent ( MatInputWithAppearance , [ {
1487+ provide : MAT_FORM_FIELD_DEFAULT_OPTIONS , useValue : { hideRequiredMarker : true } }
1488+ ] ) ;
1489+
1490+ fixture . detectChanges ( ) ;
1491+ expect ( fixture . componentInstance . formField . hideRequiredMarker ) . toBe ( true ) ;
1492+ } ) ;
14691493
1470- it ( 'should be custom default appearance if custom appearance specified in default options' ,
1471- fakeAsync ( ( ) => {
1472- const fixture = createComponent ( MatInputWithAppearance , [ {
1473- provide : MAT_FORM_FIELD_DEFAULT_OPTIONS , useValue : { appearance : 'fill' } }
1474- ] ) ;
1475- fixture . detectChanges ( ) ;
1476- flush ( ) ;
1477- expect ( fixture . componentInstance . formField . appearance ) . toBe ( 'fill' ) ;
1478- } ) ) ;
14791494} ) ;
14801495
14811496describe ( 'MatInput with textarea autosize' , ( ) => {
0 commit comments