Skip to content

Commit 450d5f2

Browse files
committed
uui-select: add test for disabled
1 parent 475268b commit 450d5f2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/uui-select/lib/uui-select.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { html, fixture, expect } from '@open-wc/testing';
1+
import { html, fixture, expect, elementUpdated } from '@open-wc/testing';
22
import { UUISelectElement } from './uui-select.element';
33
import '.';
44

@@ -28,6 +28,8 @@ describe('UUISelectElement', () => {
2828
describe('UUISelect in Form', () => {
2929
let formElement: HTMLFormElement;
3030
let element: UUISelectElement;
31+
let select: HTMLSelectElement;
32+
3133
beforeEach(async () => {
3234
formElement = await fixture(
3335
html` <form>
@@ -39,6 +41,7 @@ describe('UUISelect in Form', () => {
3941
</form>`
4042
);
4143
element = formElement.querySelector('uui-select') as any;
44+
select = element.shadowRoot?.querySelector('select') as HTMLSelectElement;
4245
});
4346

4447
it('value is correct', async () => {
@@ -55,4 +58,10 @@ describe('UUISelect in Form', () => {
5558
const formData = new FormData(formElement);
5659
await expect(formData.get('bar')).to.be.equal('purple');
5760
});
61+
62+
it('can be disabled', async () => {
63+
element.disabled = true;
64+
await elementUpdated(element);
65+
expect(select.disabled).to.be.true;
66+
});
5867
});

0 commit comments

Comments
 (0)