Skip to content

Commit 7b9b20a

Browse files
committed
added test for start value
1 parent 60335b3 commit 7b9b20a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

packages/uui-radio/lib/uui-radio-group.test.ts

+22
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,25 @@ describe('UuiRadioGroup when one radio child radio is checked', () => {
252252
expect(formData.get(`${element.name}`)).to.be.equal('Value 2');
253253
});
254254
});
255+
256+
describe('UuiRadioGroup with start value', () => {
257+
let radioGroup: UUIRadioGroupElement;
258+
let radios: Array<UUIRadioElement>;
259+
beforeEach(async () => {
260+
radioGroup = await fixture(
261+
html` <uui-radio-group value="2">
262+
<uui-radio value="1">one</uui-radio>
263+
<uui-radio value="2">two</uui-radio>
264+
<uui-radio value="3">three</uui-radio>
265+
<uui-radio value="4">four</uui-radio>
266+
</uui-radio-group>`
267+
);
268+
radios = Array.from(radioGroup.querySelectorAll('uui-radio'));
269+
});
270+
it('propagates the start value to the correct child radio', async () => {
271+
expect(radios[0]).to.not.have.attribute('checked');
272+
expect(radios[1]).to.have.attribute('checked');
273+
expect(radios[2]).to.not.have.attribute('checked');
274+
expect(radios[3]).to.not.have.attribute('checked');
275+
});
276+
});

0 commit comments

Comments
 (0)