test: refs #6994 add front test descriptors

This commit is contained in:
Alex Moreno 2025-03-07 14:02:21 +01:00
parent a4dfb549be
commit 564877a73c
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,14 @@
<script setup>
import AccountDescriptor from './AccountDescriptor.vue';
import AccountSummary from './AccountSummary.vue';
</script>
<template>
<QPopupProxy style="max-width: 10px">
<AccountDescriptor
v-if="$attrs.id"
v-bind="$attrs.id"
:summary="AccountSummary"
:proxy-render="true"
/>
</QPopupProxy>
</template>

View File

@ -0,0 +1,28 @@
import { describe, expect, it, beforeEach } from 'vitest';
import 'app/test/vitest/helper';
import { useDescriptorStore } from 'src/stores/useDescriptorStore';
import { useStateStore } from 'stores/useStateStore';
describe('useDescriptorStore', () => {
const { get, has } = useDescriptorStore();
const stateStore = useStateStore();
beforeEach(() => {
stateStore.setDescriptors({});
});
function getDescriptors() {
return stateStore.descriptors;
}
it('should get descriptors in stateStore', async () => {
expect(Object.keys(getDescriptors()).length).toBe(0);
get();
expect(Object.keys(getDescriptors()).length).toBeGreaterThan(0);
});
it('should find ticketDescriptor if search ticketFk', async () => {
expect(has('ticketFk')).toBeDefined();
});
});