mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
* Fix options for list & map interfaces * Create short-boxes-rescue.md * Outsource Vue component check to utils * No need for explicit comparation * Depend on `typeof` instead of `instanceof` to check Vue comp Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> * make linter happy --------- Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> Co-authored-by: Brainslug <tim@brainslug.nl>
24 lines
540 B
TypeScript
24 lines
540 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { defineComponent } from 'vue';
|
|
import { isVueComponent } from './is-vue-component.js';
|
|
|
|
describe('isVueComponent', () => {
|
|
it('returns true if input is a Vue component', () => {
|
|
const Component = defineComponent(() => {
|
|
return () => {
|
|
//
|
|
};
|
|
});
|
|
|
|
const result = isVueComponent(Component);
|
|
|
|
expect(result).toEqual(true);
|
|
});
|
|
|
|
it('returns false if input is not a Vue component', () => {
|
|
const result = isVueComponent({});
|
|
|
|
expect(result).toEqual(false);
|
|
});
|
|
});
|