Refactor tests to use radio button index for API version selection validation

This commit is contained in:
2026-01-29 05:13:18 +00:00
parent 5a56aa4cbc
commit 66eae1ddcd

View File

@@ -12,7 +12,8 @@ describe('ApiVersionSelector', () => {
props: { modelValue: 'v2.1' } props: { modelValue: 'v2.1' }
}); });
expect(wrapper.find('input[value="v2.1"]').element.checked).toBe(true); const radios = wrapper.findAll('input[type="radio"]');
expect(radios[1].element.checked).toBe(true);
expect(wrapper.text()).toContain('Using API v2.1'); expect(wrapper.text()).toContain('Using API v2.1');
}); });
@@ -21,7 +22,8 @@ describe('ApiVersionSelector', () => {
props: { modelValue: 'v1' } props: { modelValue: 'v1' }
}); });
expect(wrapper.find('input[value="v1"]').element.checked).toBe(true); const radios = wrapper.findAll('input[type="radio"]');
expect(radios[0].element.checked).toBe(true);
expect(wrapper.text()).toContain('Using API v1'); expect(wrapper.text()).toContain('Using API v1');
}); });