27 lines
728 B
JavaScript
27 lines
728 B
JavaScript
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');
|
|
}
|
|
});
|