test: refs #6994 add front test descriptors
This commit is contained in:
parent
a4dfb549be
commit
564877a73c
|
@ -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>
|
|
@ -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();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue