Enhance bug reporting from within the app (#16566)

* Fix paths of imports

* Process not-found.vue as ts

To prevent the following error from 'vue-tsc':
  error TS6504: File '/Users/pascal/Development/directus/app/src/modules/insights/routes/not-found.vue.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?

Note: We could also enable 'allowJS' but since this is the only js file
this seems to be a more fitting fix

* Drop hljs language definition for GraphQL (now in core)

* Enhance bug reporting from within the app

* Simplify simplify simplify

---------

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
Pascal Jufer
2023-04-11 21:04:26 +02:00
committed by GitHub
parent 15b91dee34
commit f09f440146
5 changed files with 64 additions and 96 deletions

View File

@@ -0,0 +1,36 @@
import { test, expect, beforeEach } from 'vitest';
import { mount } from '@vue/test-utils';
import VMenu from './v-menu.vue';
import TransitionBounce from './transition/bounce.vue';
import { GlobalMountOptions } from '@vue/test-utils/dist/types';
import { directive } from '@/directives/click-outside';
beforeEach(() => {
// create teleport target
const el = document.createElement('div');
el.id = 'menu-outlet';
document.body.appendChild(el);
});
const global: GlobalMountOptions = {
directives: {
'click-outside': directive,
},
components: {
TransitionBounce,
},
};
test('Mount component', () => {
expect(VMenu).toBeTruthy();
const wrapper = mount(VMenu, {
slots: {
default: 'Slot Content',
},
global,
});
expect(wrapper.html()).toMatchSnapshot();
});