1
1
import { expect , fixture , html } from '@open-wc/testing' ;
2
2
import '../dist/index.js' ;
3
-
3
+ import '@material/web/button/filled-button.js' ;
4
+ import { MdFilledButton } from '@material/web/button/filled-button.js' ;
4
5
class TestInput extends HTMLElement {
5
6
static formAssociated = true ;
6
7
internals = this . attachInternals ( ) ;
@@ -22,18 +23,20 @@ async function createForm(): Promise<HTMLFormElement> {
22
23
< test-input name ="second " id ="ti2 "> </ test-input >
23
24
< test-input name ="third " id ="ti3 "> </ test-input >
24
25
< button type ="submit "> Submit</ button >
26
+ < md-filled-button type ="submit "> Submit Material</ md-filled-button >
25
27
</ form > ` ) ;
26
28
}
27
29
28
30
it ( 'must contains the custom elements associated to the current form, in the correct order' , async ( ) => {
29
31
const form = await createForm ( ) ;
30
- expect ( form . elements ) . to . have . length ( 5 ) ;
32
+ expect ( form . elements ) . to . have . length ( 6 ) ;
31
33
32
34
expect ( form . elements [ 0 ] ) . to . be . an . instanceof ( HTMLInputElement ) ;
33
35
expect ( form . elements [ 1 ] ) . to . be . an . instanceof ( TestInput ) ;
34
36
expect ( form . elements [ 2 ] ) . to . be . an . instanceof ( TestInput ) ;
35
37
expect ( form . elements [ 3 ] ) . to . be . an . instanceof ( TestInput ) ;
36
38
expect ( form . elements [ 4 ] ) . to . be . an . instanceof ( HTMLButtonElement ) ;
39
+ expect ( form . elements [ 5 ] ) . to . be . an . instanceof ( MdFilledButton ) ;
37
40
38
41
expect ( form . elements [ 0 ] . id ) . to . equal ( 'foo' ) ;
39
42
expect ( form . elements [ 1 ] . id ) . to . equal ( 'ti1' ) ;
0 commit comments