mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-20 15:23:50 +02:00
use oxfmt instead of prettier
This commit is contained in:
@@ -5,8 +5,16 @@ vi.mock('vue-i18n', () => ({ useI18n: () => ({ t: (k) => k }) }));
|
||||
vi.mock('@/shared/utils/common', () => ({ openExternalLink: vi.fn() }));
|
||||
vi.mock('../../../stores', () => ({
|
||||
useDashboardStore: () => ({
|
||||
createDashboard: vi.fn(async () => ({ id: 'dashboard-1', name: 'Dashboard', icon: 'ri-dashboard-line' })),
|
||||
getDashboard: vi.fn(() => ({ id: 'dashboard-1', name: 'Dashboard', icon: 'ri-dashboard-line' })),
|
||||
createDashboard: vi.fn(async () => ({
|
||||
id: 'dashboard-1',
|
||||
name: 'Dashboard',
|
||||
icon: 'ri-dashboard-line'
|
||||
})),
|
||||
getDashboard: vi.fn(() => ({
|
||||
id: 'dashboard-1',
|
||||
name: 'Dashboard',
|
||||
icon: 'ri-dashboard-line'
|
||||
})),
|
||||
updateDashboard: vi.fn(async () => {}),
|
||||
deleteDashboard: vi.fn(async () => {}),
|
||||
setEditingDashboardId: vi.fn()
|
||||
@@ -25,7 +33,8 @@ vi.mock('@/components/ui/dialog', () => ({
|
||||
vi.mock('@/components/ui/button', () => ({
|
||||
Button: {
|
||||
emits: ['click'],
|
||||
template: '<button data-testid="btn" @click="$emit(\'click\')"><slot /></button>'
|
||||
template:
|
||||
'<button data-testid="btn" @click="$emit(\'click\')"><slot /></button>'
|
||||
}
|
||||
}));
|
||||
vi.mock('@/components/ui/hover-card', () => ({
|
||||
@@ -37,17 +46,26 @@ vi.mock('@/components/ui/input-group', () => ({
|
||||
InputGroupButton: { template: '<button><slot /></button>' },
|
||||
InputGroupField: { template: '<input />' }
|
||||
}));
|
||||
vi.mock('@/components/ui/separator', () => ({ Separator: { template: '<hr />' } }));
|
||||
vi.mock('@/components/ui/separator', () => ({
|
||||
Separator: { template: '<hr />' }
|
||||
}));
|
||||
vi.mock('@/components/ui/tree', () => ({
|
||||
Tree: {
|
||||
props: ['items'],
|
||||
template: '<div><slot :flatten-items="[]" /></div>'
|
||||
}
|
||||
}));
|
||||
vi.mock('@dnd-kit/vue', () => ({ DragDropProvider: { template: '<div><slot /></div>' } }));
|
||||
vi.mock('@dnd-kit/vue', () => ({
|
||||
DragDropProvider: { template: '<div><slot /></div>' }
|
||||
}));
|
||||
vi.mock('@dnd-kit/vue/sortable', () => ({ isSortable: () => false }));
|
||||
vi.mock('lucide-vue-next', () => new Proxy({}, { get: () => ({ template: '<i />' }) }));
|
||||
vi.mock('../SortableTreeNode.vue', () => ({ default: { template: '<div />' } }));
|
||||
vi.mock(
|
||||
'lucide-vue-next',
|
||||
() => new Proxy({}, { get: () => ({ template: '<i />' }) })
|
||||
);
|
||||
vi.mock('../SortableTreeNode.vue', () => ({
|
||||
default: { template: '<div />' }
|
||||
}));
|
||||
|
||||
import CustomNavDialog from '../CustomNavDialog.vue';
|
||||
|
||||
@@ -74,8 +92,12 @@ describe('CustomNavDialog.vue', () => {
|
||||
});
|
||||
|
||||
const buttons = wrapper.findAll('[data-testid="btn"]');
|
||||
const resetButton = buttons.find((button) => button.text().includes('nav_menu.custom_nav.restore_default'));
|
||||
const saveButton = buttons.find((button) => button.text().includes('common.actions.confirm'));
|
||||
const resetButton = buttons.find((button) =>
|
||||
button.text().includes('nav_menu.custom_nav.restore_default')
|
||||
);
|
||||
const saveButton = buttons.find((button) =>
|
||||
button.text().includes('common.actions.confirm')
|
||||
);
|
||||
|
||||
await resetButton.trigger('click');
|
||||
await saveButton.trigger('click');
|
||||
|
||||
Reference in New Issue
Block a user