✅ Refactor tests to use radio button index for API version selection validation
This commit is contained in:
@@ -12,7 +12,8 @@ describe('ApiVersionSelector', () => {
|
||||
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');
|
||||
});
|
||||
|
||||
@@ -21,7 +22,8 @@ describe('ApiVersionSelector', () => {
|
||||
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');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user