From 0afd5b62c795d314181ac609726f68a439467f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Wed, 20 Apr 2022 12:11:13 +0300 Subject: [PATCH] Create Ripple.spec.js --- src/components/ripple/Ripple.spec.js | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/components/ripple/Ripple.spec.js diff --git a/src/components/ripple/Ripple.spec.js b/src/components/ripple/Ripple.spec.js new file mode 100644 index 000000000..f3a9b220a --- /dev/null +++ b/src/components/ripple/Ripple.spec.js @@ -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: ` +
Default
+ ` + }); + + 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'); + }); +}); \ No newline at end of file