@@ -21,7 +21,7 @@ describe('MatButtonHarness', () => {
21
21
22
22
it ( 'should load all button harnesses' , async ( ) => {
23
23
const buttons = await loader . getAllHarnesses ( MatButtonHarness ) ;
24
- expect ( buttons . length ) . toBe ( 17 ) ;
24
+ expect ( buttons . length ) . toBe ( 18 ) ;
25
25
} ) ;
26
26
27
27
it ( 'should load button with exact text' , async ( ) => {
@@ -40,7 +40,7 @@ describe('MatButtonHarness', () => {
40
40
it ( 'should filter by whether a button is disabled' , async ( ) => {
41
41
const enabledButtons = await loader . getAllHarnesses ( MatButtonHarness . with ( { disabled : false } ) ) ;
42
42
const disabledButtons = await loader . getAllHarnesses ( MatButtonHarness . with ( { disabled : true } ) ) ;
43
- expect ( enabledButtons . length ) . toBe ( 15 ) ;
43
+ expect ( enabledButtons . length ) . toBe ( 16 ) ;
44
44
expect ( disabledButtons . length ) . toBe ( 2 ) ;
45
45
} ) ;
46
46
@@ -59,6 +59,13 @@ describe('MatButtonHarness', () => {
59
59
expect ( await disabledElevatedAnchor . isDisabled ( ) ) . toBe ( true ) ;
60
60
} ) ;
61
61
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
+
62
69
it ( 'should get button text' , async ( ) => {
63
70
const [ firstButton , secondButton ] = await loader . getAllHarnesses ( MatButtonHarness ) ;
64
71
expect ( await firstButton . getText ( ) ) . toBe ( 'Basic button' ) ;
@@ -127,6 +134,7 @@ describe('MatButtonHarness', () => {
127
134
'basic' ,
128
135
'basic' ,
129
136
'basic' ,
137
+ 'basic' ,
130
138
'icon' ,
131
139
'fab' ,
132
140
'mini-fab' ,
@@ -148,6 +156,7 @@ describe('MatButtonHarness', () => {
148
156
null ,
149
157
null ,
150
158
'text' ,
159
+ 'text' ,
151
160
'filled' ,
152
161
'elevated' ,
153
162
'outlined' ,
@@ -199,6 +208,7 @@ describe('MatButtonHarness', () => {
199
208
</button>
200
209
<button id="fab" type="button" matFab>Fab button</button>
201
210
<button id="mini-fab" type="button" matMiniFab>Mini Fab button</button>
211
+ <button id="submit" type="submit" matButton>Submit button</button>
202
212
203
213
<a id="anchor-basic" matButton>Basic anchor</a>
204
214
<a id="anchor-flat" matButton="filled">Filled anchor</a>
0 commit comments