test: refs #6994 create test VnLogValue front
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit
Details
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit
Details
This commit is contained in:
parent
0a9560f286
commit
fc549cae97
|
@ -0,0 +1,26 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import VnLogValue from 'src/components/common/VnLogValue.vue';
|
||||
import { createWrapper } from 'app/test/vitest/helper';
|
||||
|
||||
const buildComponent = (props) => {
|
||||
return createWrapper(VnLogValue, {
|
||||
props,
|
||||
global: {},
|
||||
}).wrapper;
|
||||
};
|
||||
|
||||
describe('VnLogValue', () => {
|
||||
const id = 1;
|
||||
it('renders without descriptor', async () => {
|
||||
expect(getIcon('inventFk').exists()).toBe(false);
|
||||
});
|
||||
|
||||
it('renders with descriptor', async () => {
|
||||
expect(getIcon('claimFk').text()).toBe('launch');
|
||||
});
|
||||
|
||||
function getIcon(name) {
|
||||
const wrapper = buildComponent({ value: { val: id }, name });
|
||||
return wrapper.find('.q-icon');
|
||||
}
|
||||
});
|
|
@ -2,9 +2,8 @@ import { defineAsyncComponent } from 'vue';
|
|||
import { defineStore } from 'pinia';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
|
||||
const { descriptors, setDescriptors } = useStateStore();
|
||||
|
||||
export const useDescriptorStore = defineStore('descriptorStore', () => {
|
||||
const { descriptors, setDescriptors } = useStateStore();
|
||||
function get() {
|
||||
if (Object.keys(descriptors).length) return descriptors;
|
||||
|
||||
|
|
Loading…
Reference in New Issue