Create Ripple.spec.js

pull/2484/head
Tuğçe Küçükoğlu 2022-04-20 12:11:13 +03:00
parent ae1a54bea5
commit 0afd5b62c7
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
import { config, mount } from '@vue/test-utils';
import Ripple from './Ripple';
config.global.mocks = {
$primevue: {
config: {
ripple: true
}
}
}
config.global.directives = {
Ripple
}
describe('Ripple', () => {
it('should exist', async () => {
const wrapper = mount({
template: `
<div class="card p-ripple" v-ripple>Default</div>
`
});
const card = wrapper.find('.card');
expect(wrapper.find('.p-ink').exists()).toBe(true);
await card.trigger('mousedown');
expect(wrapper.find('.p-ink').classes()).toContain('p-ink-active');
});
});