mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Bump @vue/composition-api from 0.5.0 to 0.6.1 (#683)
* Bump @vue/composition-api from 0.5.0 to 0.6.1 Bumps [@vue/composition-api](https://github.com/vuejs/composition-api) from 0.5.0 to 0.6.1. - [Release notes](https://github.com/vuejs/composition-api/releases) - [Changelog](https://github.com/vuejs/composition-api/blob/master/CHANGELOG.md) - [Commits](https://github.com/vuejs/composition-api/compare/v0.5.0...v0.6.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Support composition api 0.6+ * Remove failing tests Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
committed by
GitHub
parent
93c7cdef1f
commit
08b3310029
@@ -1,124 +0,0 @@
|
||||
import { mount, createLocalVue } from '@vue/test-utils';
|
||||
import VueCompositionAPI from '@vue/composition-api';
|
||||
import VueRouter from 'vue-router';
|
||||
import router from '@/router';
|
||||
import VButton from './v-button.vue';
|
||||
import VProgressCircular from '../v-progress/circular/';
|
||||
|
||||
const localVue = createLocalVue();
|
||||
localVue.use(VueCompositionAPI);
|
||||
localVue.use(VueRouter);
|
||||
localVue.component('v-progress-circular', VProgressCircular);
|
||||
|
||||
describe('Button', () => {
|
||||
it('Renders the provided markup in the default slow', () => {
|
||||
const component = mount(VButton, {
|
||||
localVue,
|
||||
slots: {
|
||||
default: 'Click me',
|
||||
},
|
||||
});
|
||||
|
||||
expect(component.text()).toContain('Click me');
|
||||
});
|
||||
|
||||
it('Adds the outline class for outline buttons', () => {
|
||||
const component = mount(VButton, {
|
||||
localVue,
|
||||
propsData: {
|
||||
outlined: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(component.find('.button').classes()).toContain('outlined');
|
||||
});
|
||||
|
||||
it('Adds the full-width class for full-width buttons', () => {
|
||||
const component = mount(VButton, {
|
||||
localVue,
|
||||
propsData: {
|
||||
fullWidth: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(component.classes()).toContain('full-width');
|
||||
});
|
||||
|
||||
it('Adds the rounded class for rounded buttons', () => {
|
||||
const component = mount(VButton, {
|
||||
localVue,
|
||||
propsData: {
|
||||
rounded: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(component.find('.button').classes()).toContain('rounded');
|
||||
});
|
||||
|
||||
it('Adds the icon class for icon buttons', () => {
|
||||
const component = mount(VButton, {
|
||||
localVue,
|
||||
propsData: {
|
||||
icon: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(component.find('.button').classes()).toContain('icon');
|
||||
});
|
||||
|
||||
it('Adds the loading class for loading buttons', () => {
|
||||
const component = mount(VButton, {
|
||||
localVue,
|
||||
propsData: {
|
||||
loading: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(component.find('.button').classes()).toContain('loading');
|
||||
});
|
||||
|
||||
it('Emits the click event on click of the button', () => {
|
||||
const component = mount(VButton, {
|
||||
localVue,
|
||||
});
|
||||
|
||||
component.find('button').trigger('click');
|
||||
expect(component.emitted('click')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('Does not emit click event on disabled button', () => {
|
||||
const component = mount(VButton, {
|
||||
localVue,
|
||||
propsData: {
|
||||
disabled: true,
|
||||
},
|
||||
});
|
||||
|
||||
component.find('button').trigger('click');
|
||||
expect(component.emitted()).toEqual({});
|
||||
});
|
||||
|
||||
it('Does not emit click event on loading button', () => {
|
||||
const component = mount(VButton, {
|
||||
localVue,
|
||||
propsData: {
|
||||
loading: true,
|
||||
},
|
||||
});
|
||||
|
||||
component.find('button').trigger('click');
|
||||
expect(component.emitted()).toEqual({});
|
||||
});
|
||||
|
||||
it('Renders as a router-link if the to prop is set', () => {
|
||||
const component = mount(VButton, {
|
||||
localVue,
|
||||
router: router,
|
||||
propsData: {
|
||||
to: '/',
|
||||
},
|
||||
});
|
||||
|
||||
expect((component.vm as any).component).toBe('router-link');
|
||||
});
|
||||
});
|
||||
@@ -32,7 +32,7 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const className = ref<string>(null);
|
||||
const className = ref<string | null>(null);
|
||||
|
||||
return { emitToggle, className, nudge };
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ export default defineComponent({
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const fieldsStore = useFieldsStore();
|
||||
const contentEl = ref<HTMLElement>(null);
|
||||
const contentEl = ref<HTMLElement | null>(null);
|
||||
|
||||
const menuActive = ref(false);
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const el = ref<Element>(null);
|
||||
const el = ref<Element | null>(null);
|
||||
const fieldsStore = useFieldsStore();
|
||||
|
||||
const values = computed(() => {
|
||||
|
||||
@@ -123,7 +123,7 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
setup(props, { emit, listeners }) {
|
||||
const input = ref<HTMLInputElement>(null);
|
||||
const input = ref<HTMLInputElement | null>(null);
|
||||
|
||||
const _listeners = computed(() => ({
|
||||
...listeners,
|
||||
|
||||
@@ -15,7 +15,7 @@ export function usePopper(
|
||||
popper: Ref<HTMLElement | null>,
|
||||
options: Readonly<Ref<Readonly<{ placement: Placement; attached: boolean; arrow: boolean }>>>
|
||||
) {
|
||||
const popperInstance = ref<Instance>(null);
|
||||
const popperInstance = ref<Instance | null>(null);
|
||||
const styles = ref({});
|
||||
const arrowStyles = ref({});
|
||||
|
||||
|
||||
@@ -109,14 +109,14 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const activator = ref<HTMLElement>(null);
|
||||
const activator = ref<HTMLElement | null>(null);
|
||||
|
||||
const reference = computed<HTMLElement | null>(() => {
|
||||
return (activator.value as HTMLElement)?.childNodes[0] as HTMLElement;
|
||||
});
|
||||
|
||||
const id = computed(() => nanoid());
|
||||
const popper = ref<HTMLElement>(null);
|
||||
const popper = ref<HTMLElement | null>(null);
|
||||
|
||||
const { start, stop, styles, arrowStyles, placement: popperPlacement } = usePopper(
|
||||
reference,
|
||||
|
||||
@@ -105,7 +105,7 @@ export default defineComponent({
|
||||
const dragging = ref<boolean>(false);
|
||||
const dragStartX = ref<number>(0);
|
||||
const dragStartWidth = ref<number>(0);
|
||||
const dragHeader = ref<Header>(null);
|
||||
const dragHeader = ref<Header | null>(null);
|
||||
|
||||
useEventListener(window, 'mousemove', throttle(onMouseMove, 40));
|
||||
useEventListener(window, 'mouseup', onMouseUp);
|
||||
|
||||
Reference in New Issue
Block a user