feat(GOV-009): 建立 Vue 前端工程基线
This commit is contained in:
@@ -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 股市场分析工具');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user