@@ -21,7 +21,7 @@ describe('MatButtonHarness', () => {
2121
2222 it ( 'should load all button harnesses' , async ( ) => {
2323 const buttons = await loader . getAllHarnesses ( MatButtonHarness ) ;
24- expect ( buttons . length ) . toBe ( 17 ) ;
24+ expect ( buttons . length ) . toBe ( 18 ) ;
2525 } ) ;
2626
2727 it ( 'should load button with exact text' , async ( ) => {
@@ -40,7 +40,7 @@ describe('MatButtonHarness', () => {
4040 it ( 'should filter by whether a button is disabled' , async ( ) => {
4141 const enabledButtons = await loader . getAllHarnesses ( MatButtonHarness . with ( { disabled : false } ) ) ;
4242 const disabledButtons = await loader . getAllHarnesses ( MatButtonHarness . with ( { disabled : true } ) ) ;
43- expect ( enabledButtons . length ) . toBe ( 15 ) ;
43+ expect ( enabledButtons . length ) . toBe ( 16 ) ;
4444 expect ( disabledButtons . length ) . toBe ( 2 ) ;
4545 } ) ;
4646
@@ -59,6 +59,13 @@ describe('MatButtonHarness', () => {
5959 expect ( await disabledElevatedAnchor . isDisabled ( ) ) . toBe ( true ) ;
6060 } ) ;
6161
62+ it ( 'should load button with type attribute' , async ( ) => {
63+ const buttons = await loader . getAllHarnesses ( MatButtonHarness . with ( { type : 'submit' } ) ) ;
64+ expect ( buttons . length ) . toBe ( 1 ) ;
65+ expect ( await buttons [ 0 ] . getText ( ) ) . toBe ( 'Submit button' ) ;
66+ expect ( await buttons [ 0 ] . getType ( ) ) . toBe ( 'submit' ) ;
67+ } ) ;
68+
6269 it ( 'should get button text' , async ( ) => {
6370 const [ firstButton , secondButton ] = await loader . getAllHarnesses ( MatButtonHarness ) ;
6471 expect ( await firstButton . getText ( ) ) . toBe ( 'Basic button' ) ;
@@ -127,6 +134,7 @@ describe('MatButtonHarness', () => {
127134 'basic' ,
128135 'basic' ,
129136 'basic' ,
137+ 'basic' ,
130138 'icon' ,
131139 'fab' ,
132140 'mini-fab' ,
@@ -148,6 +156,7 @@ describe('MatButtonHarness', () => {
148156 null ,
149157 null ,
150158 'text' ,
159+ 'text' ,
151160 'filled' ,
152161 'elevated' ,
153162 'outlined' ,
@@ -199,6 +208,7 @@ describe('MatButtonHarness', () => {
199208 </button>
200209 <button id="fab" type="button" matFab>Fab button</button>
201210 <button id="mini-fab" type="button" matMiniFab>Mini Fab button</button>
211+ <button id="submit" type="submit" matButton>Submit button</button>
202212
203213 <a id="anchor-basic" matButton>Basic anchor</a>
204214 <a id="anchor-flat" matButton="filled">Filled anchor</a>
0 commit comments