1
- import { html , fixture , expect } from '@open-wc/testing' ;
1
+ import { html , fixture , expect , elementUpdated } from '@open-wc/testing' ;
2
2
import { UUISelectElement } from './uui-select.element' ;
3
3
import '.' ;
4
4
@@ -28,6 +28,8 @@ describe('UUISelectElement', () => {
28
28
describe ( 'UUISelect in Form' , ( ) => {
29
29
let formElement : HTMLFormElement ;
30
30
let element : UUISelectElement ;
31
+ let select : HTMLSelectElement ;
32
+
31
33
beforeEach ( async ( ) => {
32
34
formElement = await fixture (
33
35
html ` < form >
@@ -39,6 +41,7 @@ describe('UUISelect in Form', () => {
39
41
</ form > `
40
42
) ;
41
43
element = formElement . querySelector ( 'uui-select' ) as any ;
44
+ select = element . shadowRoot ?. querySelector ( 'select' ) as HTMLSelectElement ;
42
45
} ) ;
43
46
44
47
it ( 'value is correct' , async ( ) => {
@@ -55,4 +58,10 @@ describe('UUISelect in Form', () => {
55
58
const formData = new FormData ( formElement ) ;
56
59
await expect ( formData . get ( 'bar' ) ) . to . be . equal ( 'purple' ) ;
57
60
} ) ;
61
+
62
+ it ( 'can be disabled' , async ( ) => {
63
+ element . disabled = true ;
64
+ await elementUpdated ( element ) ;
65
+ expect ( select . disabled ) . to . be . true ;
66
+ } ) ;
58
67
} ) ;
0 commit comments