feat(ECR-012): 星座对齐收口,并 Closed ECR-007/008
对齐 outlook/分享 type=star/报告页运势面板与测试;流程上关闭 Ops-B/C 两张 ECR。真支付仍后置。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,8 +4,11 @@ import StarProfilePage from './StarProfilePage.vue'
|
||||
|
||||
const { api, routeQuery } = vi.hoisted(() => ({
|
||||
api: {
|
||||
authMe: vi.fn(),
|
||||
listProfiles: vi.fn(),
|
||||
createProfile: vi.fn(),
|
||||
createStar: vi.fn(),
|
||||
getLatestReport: vi.fn(),
|
||||
getReport: vi.fn(),
|
||||
createOrder: vi.fn(),
|
||||
payMock: vi.fn(),
|
||||
@@ -15,8 +18,8 @@ const { api, routeQuery } = vi.hoisted(() => ({
|
||||
|
||||
vi.mock('../api/client', () => ({ api }))
|
||||
vi.mock('vue-router', () => ({
|
||||
useRoute: () => ({ query: routeQuery }),
|
||||
useRouter: () => ({ back: vi.fn() }),
|
||||
useRoute: () => ({ query: routeQuery, fullPath: '/star?y=1990&m=5&d=12' }),
|
||||
useRouter: () => ({ back: vi.fn(), replace: vi.fn(), push: vi.fn() }),
|
||||
}))
|
||||
|
||||
const summary = {
|
||||
@@ -39,22 +42,29 @@ const summary = {
|
||||
keywords: ['金牛'],
|
||||
}
|
||||
|
||||
const starReport = {
|
||||
id: 'r1',
|
||||
type: 'star',
|
||||
has_deep_access: false,
|
||||
summary,
|
||||
detail: null,
|
||||
}
|
||||
|
||||
describe('StarProfilePage', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
api.authMe.mockResolvedValue({ id: 'u1' })
|
||||
api.listProfiles.mockResolvedValue({ items: [] })
|
||||
api.createProfile.mockResolvedValue({ id: 'p1' })
|
||||
api.createStar.mockResolvedValue({
|
||||
id: 'r1',
|
||||
has_deep_access: false,
|
||||
summary,
|
||||
detail: null,
|
||||
})
|
||||
api.getLatestReport.mockResolvedValue(starReport)
|
||||
api.createStar.mockResolvedValue(starReport)
|
||||
})
|
||||
|
||||
it('shows natal wheel and free chart content', async () => {
|
||||
const w = mount(StarProfilePage, { global: { stubs: { RouterLink: true } } })
|
||||
await flushPromises()
|
||||
expect(api.createStar).toHaveBeenCalled()
|
||||
expect(api.createProfile).toHaveBeenCalled()
|
||||
expect(api.getLatestReport).toHaveBeenCalledWith('p1', 'star')
|
||||
await w.findAll('button').find((b) => b.text() === '星盘')!.trigger('click')
|
||||
await flushPromises()
|
||||
expect(w.find('svg.wheel').exists()).toBe(true)
|
||||
|
||||
Reference in New Issue
Block a user