feat(design): integrate conversation-first creation flow
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
brother7 committed 2026-09-04 07:39:58 +08:00
1 parent 14efa99f0c
commit 945b40de11
14 files changed
+374 -234

No files matched your search

+11 -15
View File
@@ -100,7 +100,8 @@ describe('YouthCreationCard', () => {
it('shows a plain creation summary and offers a youth-facing ready action', () => {
const { requestQuote } = renderCard();
expect(screen.getByRole('heading', { name: '我的创作' })).toBeInTheDocument();
expect(screen.getByRole('heading', { name: 'AI 听懂的想法' })).toBeInTheDocument();
expect(screen.getByText('会跟着聊天自动更新,不需要逐项填写。')).toBeInTheDocument();
expect(screen.getByText('把便携咖啡机呈现为城市通勤中的精密工具')).toBeInTheDocument();
expect(screen.getByText('图片')).toBeInTheDocument();
expect(screen.getByText('竖版海报')).toBeInTheDocument();
@@ -113,7 +114,7 @@ describe('YouthCreationCard', () => {
expect(requestQuote).toHaveBeenCalledOnce();
});
it('shows only the first choice, keeps the server label, and resolves it through the store', () => {
it('does not surface legacy decision prompts as a form', () => {
const workspace = designWorkspaceFixture({
form: designFormFixture({
decisionPrompts: [{
@@ -141,18 +142,12 @@ describe('YouthCreationCard', () => {
});
const { resolveDecisionPrompt } = renderCard(workspace);
expect(screen.getByTestId('youth-creation-choice')).toBeInTheDocument();
expect(screen.getByText('画面想要什么感觉?')).toBeInTheDocument();
expect(screen.getByRole('button', { name: /有趣的卡通/ })).toHaveClass('min-h-11');
expect(screen.getByText('推荐')).toBeInTheDocument();
expect(screen.getByRole('button', { name: /你帮我选/ })).toBeInTheDocument();
expect(screen.queryByTestId('youth-creation-choice')).not.toBeInTheDocument();
expect(screen.queryByText('画面想要什么感觉?')).not.toBeInTheDocument();
expect(screen.queryByRole('button', { name: /有趣的卡通/ })).not.toBeInTheDocument();
expect(screen.queryByRole('button', { name: /你帮我选/ })).not.toBeInTheDocument();
expect(screen.queryByText('这个问题不该显示')).not.toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: /你帮我选/ }));
expect(resolveDecisionPrompt).toHaveBeenCalledWith('choice-1', 'select', 'delegate');
fireEvent.click(screen.getByRole('button', { name: '先跳过这题' }));
expect(resolveDecisionPrompt).toHaveBeenCalledWith('choice-1', 'reject');
expect(resolveDecisionPrompt).not.toHaveBeenCalled();
});
it('shows known must-have, must-avoid, reference, video, and plain blocker details only', () => {
@@ -213,6 +208,7 @@ describe('YouthCreationCard', () => {
renderCard(workspace, { quoteBlockers: [blocker] });
fireEvent.click(screen.getByText('查看画面细节'));
expect(screen.getByText('一定要有')).toBeInTheDocument();
expect(screen.getByText('远处的地球')).toBeInTheDocument();
expect(screen.getByText('想保留')).toBeInTheDocument();
@@ -258,10 +254,10 @@ describe('YouthCreationCard', () => {
);
expect(within(screen.getByTestId('youth-creation-readiness')).getByText('等你的第一个想法')).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: '先说一个想法' }));
fireEvent.click(screen.getByRole('button', { name: '开始描述' }));
expect(onFocusComposer).toHaveBeenCalledOnce();
fireEvent.click(screen.getByRole('button', { name: '精细调整' }));
fireEvent.click(screen.getByRole('button', { name: '手动调整(可选)' }));
expect(onOpenFineTune).toHaveBeenCalledOnce();
});