DigitalConsumer.FixMyGlass/src/uxComponents/radio/radio.spec.js
2021-11-10 09:41:10 -05:00

23 lines
No EOL
799 B
JavaScript

import { shallowMount } from '@vue/test-utils';
import radio from './radio';
describe('radio.vue', () => {
it("Should render the 'text' prop value as a span value for the radio button label and add the 'value' prop value as the radio button value and id.", () => {
// Act
const wrapper = shallowMount(radio, {
propsData: {
value: 'radio_button_value',
text: 'Radio Button Text'
}
});
// Assert
expect(wrapper.find('span').text()).toEqual('Radio Button Text');
expect(wrapper.find('input').attributes()).toEqual({
class: 'position-absolute opacity-0',
id: 'radio_button_value',
type: 'radio',
value: 'radio_button_value'
});
})
})