primevue-mirror/components/lib/ripple/Ripple.spec.js

33 lines
678 B
JavaScript
Raw Normal View History

2022-09-06 12:03:37 +00:00
import { config, mount } from '@vue/test-utils';
import Ripple from './Ripple';
config.global.mocks = {
$primevue: {
config: {
ripple: true
}
}
2022-09-14 11:26:01 +00:00
};
2022-09-06 12:03:37 +00:00
config.global.directives = {
Ripple
2022-09-14 11:26:01 +00:00
};
2022-09-06 12:03:37 +00:00
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');
});
2022-09-14 11:26:01 +00:00
});