mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-10 01:12:37 +00:00
Styles imported. Components added
This commit is contained in:
parent
3cb3910561
commit
8264983db4
452 changed files with 55902 additions and 0 deletions
34
components/radiobutton/RadioButton.spec.js
Normal file
34
components/radiobutton/RadioButton.spec.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
import { mount } from '@vue/test-utils';
|
||||
import RadioButton from './RadioButton.vue';
|
||||
|
||||
describe('RadioButton.vue', () => {
|
||||
let wrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = mount(RadioButton, {
|
||||
props: {
|
||||
value: 'Tatooine',
|
||||
modelValue: null
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('shoukd exist', () => {
|
||||
expect(wrapper.find('.p-radiobutton.p-component').exists()).toBe(true);
|
||||
expect(wrapper.find('input').attributes().type).toBe('radio');
|
||||
});
|
||||
|
||||
it('should clicked', async () => {
|
||||
await wrapper.vm.onClick({});
|
||||
|
||||
expect(wrapper.emitted()['update:modelValue'][0]).toEqual(['Tatooine']);
|
||||
expect(wrapper.emitted().change[0]).toEqual([{}]);
|
||||
});
|
||||
|
||||
it('should checked', async () => {
|
||||
await wrapper.setProps({ modelValue: 'Tatooine'});
|
||||
|
||||
expect(wrapper.vm.checked).toBe(true);
|
||||
expect(wrapper.find('.p-radiobutton').classes()).toContain('p-radiobutton-checked');
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue