mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Styles imported. Components added
This commit is contained in:
parent
3cb3910561
commit
8264983db4
452 changed files with 55902 additions and 0 deletions
36
components/styleclass/StyleClass.spec.js
Normal file
36
components/styleclass/StyleClass.spec.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { config, mount } from '@vue/test-utils';
|
||||
import StyleClass from './StyleClass';
|
||||
import Button from '@/components/button/Button.vue';
|
||||
import InputText from '@/components/inputtext/InputText.vue';
|
||||
|
||||
config.global.directives = {
|
||||
'styleclass': StyleClass
|
||||
}
|
||||
|
||||
describe('StyleClass', () => {
|
||||
it('should work with next selector', async () => {
|
||||
const wrapper = mount({
|
||||
template: `
|
||||
<Button label="Toggle p-disabled" v-styleclass="{ selector: '@next', toggleClass: 'p-disabled' }" />
|
||||
<InputText class="block mt-3" />
|
||||
`,
|
||||
components: {
|
||||
Button,
|
||||
InputText
|
||||
}
|
||||
});
|
||||
|
||||
const button = wrapper.find('.p-button');
|
||||
const input = wrapper.find('.p-inputtext');
|
||||
|
||||
expect(input.classes()).not.toContain('p-disabled');
|
||||
|
||||
await button.trigger('click');
|
||||
|
||||
expect(input.classes()).toContain('p-disabled');
|
||||
|
||||
await button.trigger('click');
|
||||
|
||||
expect(input.classes()).not.toContain('p-disabled');
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue