feat(global): initialize project and framework structure, dockerize
This commit is contained in:
22
app/components/PrimeButtonDemo.spec.ts
Normal file
22
app/components/PrimeButtonDemo.spec.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { nextTick } from 'vue';
|
||||
import PrimeVue from 'primevue/config';
|
||||
import Button from 'primevue/button';
|
||||
import Dialog from 'primevue/dialog';
|
||||
import PrimeButtonDemo from './PrimeButtonDemo.vue';
|
||||
import { it, expect } from 'vitest';
|
||||
|
||||
it('opens dialog on click', async () => {
|
||||
const wrapper = mount(PrimeButtonDemo, {
|
||||
attachTo: document.body,
|
||||
global: {
|
||||
plugins: [PrimeVue],
|
||||
components: { Button, Dialog },
|
||||
},
|
||||
});
|
||||
|
||||
await wrapper.find('button').trigger('click');
|
||||
await nextTick();
|
||||
|
||||
expect(document.body.innerHTML).toContain('PrimeVue is working');
|
||||
});
|
||||
15
app/components/PrimeButtonDemo.vue
Normal file
15
app/components/PrimeButtonDemo.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
const _open = ref(false);
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div class="space-y-2">
|
||||
<Button type="button" label="Open Dialog" @click="_open = true" @keyup.enter="_open = true" />
|
||||
<Dialog v-model:visible="_open" modal header="Hello" :draggable="false">
|
||||
<p>PrimeVue is working.</p>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user