feat(GOV-009): 建立 Vue 前端工程基线

This commit is contained in:
2026-08-13 16:42:25 +08:00
parent 258a2d21f6
commit 28d54186ad
27 changed files with 3909 additions and 14 deletions
+25
View File
@@ -0,0 +1,25 @@
import { createPinia } from 'pinia';
import { mount } from '@vue/test-utils';
import { createMemoryHistory } from 'vue-router';
import { describe, expect, it } from 'vitest';
import App from './App.vue';
import { createAppRouter } from './router';
describe('应用外壳', () => {
it('提供可访问的应用标题和主内容区域', async () => {
const router = createAppRouter(createMemoryHistory());
await router.push('/');
await router.isReady();
const wrapper = mount(App, {
global: {
plugins: [createPinia(), router],
},
});
expect(wrapper.get('header').attributes('aria-label')).toBe('应用导航');
expect(wrapper.get('main').attributes('id')).toBe('main-content');
expect(wrapper.text()).toContain('A 股市场分析工具');
});
});