Skip to content

Commit b0cda63

Browse files
authored
test: remove has-label attribute tests from radio-button (#7080)
1 parent 57271a7 commit b0cda63

3 files changed

Lines changed: 26 additions & 26 deletions

File tree

‎packages/radio-group/test/dom/__snapshots__/radio-button.test.snap.js‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,28 @@
22
export const snapshots = {};
33

44
snapshots["vaadin-radio-button host default"] =
5+
`<vaadin-radio-button has-value="">
6+
<label
7+
for="input-vaadin-radio-button-1"
8+
id="label-vaadin-radio-button-0"
9+
slot="label"
10+
>
11+
</label>
12+
<input
13+
id="input-vaadin-radio-button-1"
14+
slot="input"
15+
tabindex="0"
16+
type="radio"
17+
value="on"
18+
>
19+
</vaadin-radio-button>
20+
`;
21+
/* end snapshot vaadin-radio-button host default */
22+
23+
snapshots["vaadin-radio-button host label"] =
524
`<vaadin-radio-button
625
has-label=""
726
has-value=""
8-
label="Radio button"
927
>
1028
<label
1129
for="input-vaadin-radio-button-1"
@@ -23,22 +41,19 @@ snapshots["vaadin-radio-button host default"] =
2341
>
2442
</vaadin-radio-button>
2543
`;
26-
/* end snapshot vaadin-radio-button host default */
44+
/* end snapshot vaadin-radio-button host label */
2745

2846
snapshots["vaadin-radio-button host disabled"] =
2947
`<vaadin-radio-button
3048
aria-disabled="true"
3149
disabled=""
32-
has-label=""
3350
has-value=""
34-
label="Radio button"
3551
>
3652
<label
3753
for="input-vaadin-radio-button-1"
3854
id="label-vaadin-radio-button-0"
3955
slot="label"
4056
>
41-
Radio button
4257
</label>
4358
<input
4459
disabled=""

‎packages/radio-group/test/dom/radio-button.test.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@ describe('vaadin-radio-button', () => {
88

99
beforeEach(() => {
1010
resetUniqueId();
11-
radio = fixtureSync('<vaadin-radio-button label="Radio button"></vaadin-radio-button>');
11+
radio = fixtureSync('<vaadin-radio-button></vaadin-radio-button>');
1212
});
1313

1414
describe('host', () => {
1515
it('default', async () => {
1616
await expect(radio).dom.to.equalSnapshot();
1717
});
1818

19+
it('label', async () => {
20+
radio.label = 'Radio button';
21+
await expect(radio).dom.to.equalSnapshot();
22+
});
23+
1924
it('disabled', async () => {
2025
radio.disabled = true;
2126
await expect(radio).dom.to.equalSnapshot();

‎packages/radio-group/test/radio-button.common.js‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -250,26 +250,6 @@ describe('radio-button', () => {
250250
});
251251
});
252252

253-
describe('has-label attribute', () => {
254-
beforeEach(async () => {
255-
radio = fixtureSync('<vaadin-radio-button></vaadin-radio-button>');
256-
await nextRender();
257-
});
258-
259-
it('should not set has-label attribute when label content is empty', () => {
260-
expect(radio.hasAttribute('has-label')).to.be.false;
261-
});
262-
263-
it('should set has-label attribute when the label is added', async () => {
264-
const paragraph = document.createElement('p');
265-
paragraph.textContent = 'Added label';
266-
paragraph.setAttribute('slot', 'label');
267-
radio.appendChild(paragraph);
268-
await nextFrame();
269-
expect(radio.hasAttribute('has-label')).to.be.true;
270-
});
271-
});
272-
273253
describe('focus', () => {
274254
let inputX, inputY;
275255

0 commit comments

Comments
 (0)