test(e2e): fix three cassette-fidelity gaps

- The knowledge list query is withContent:false, where the backend returns an
  empty content string; the entry served "Content for …".
- The generator and refiner prompt pairs were inverted vs the backend
  (System/Human swapped), teaching the wrong contract on two of fifteen agents.
- The GraphQL mock dropped an entry's data when it also carried errors, so a
  partial-error response could not be mocked with its data half.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Sergey Kozyrenko
2026-07-22 05:19:20 +07:00
co-authored by Claude Opus 4.8
parent be585b64f4
commit 101331c920
3 changed files with 10 additions and 4 deletions
+4 -1
View File
@@ -30,7 +30,10 @@ export const makeKnowledge = (id: string, question: string): KnowledgeDocumentFr
export const KNOWLEDGE_DOC = makeKnowledge('7', 'E2E Seed Question');
const knowledgeDocuments: ResultOf<typeof KnowledgeDocumentsDocument> = { knowledgeDocuments: [KNOWLEDGE_DOC] };
// The list query is withContent:false; the backend returns content:'' in that case (schema.graphqls).
const knowledgeDocuments: ResultOf<typeof KnowledgeDocumentsDocument> = {
knowledgeDocuments: [{ ...KNOWLEDGE_DOC, content: '' }],
};
export const knowledgesCassette = (override: Cassette = {}): Cassette =>
mergeCassettes(
@@ -27,12 +27,12 @@ const settingsPrompts: ResultOf<typeof SettingsPromptsDocument> = {
assistant: agentPrompt(PromptType.Assistant),
coder: agentPromptPair(PromptType.Coder, PromptType.QuestionCoder),
enricher: agentPromptPair(PromptType.Enricher, PromptType.QuestionEnricher),
generator: agentPromptPair(PromptType.SubtasksGenerator, PromptType.Generator),
generator: agentPromptPair(PromptType.Generator, PromptType.SubtasksGenerator),
installer: agentPromptPair(PromptType.Installer, PromptType.QuestionInstaller),
memorist: agentPromptPair(PromptType.Memorist, PromptType.QuestionMemorist),
pentester: agentPromptPair(PromptType.Pentester, PromptType.QuestionPentester),
primaryAgent: agentPrompt(PromptType.PrimaryAgent),
refiner: agentPromptPair(PromptType.SubtasksRefiner, PromptType.Refiner),
refiner: agentPromptPair(PromptType.Refiner, PromptType.SubtasksRefiner),
reflector: agentPromptPair(PromptType.Reflector, PromptType.QuestionReflector),
reporter: agentPromptPair(PromptType.Reporter, PromptType.TaskReporter),
searcher: agentPromptPair(PromptType.Searcher, PromptType.QuestionSearcher),
+4 -1
View File
@@ -26,7 +26,10 @@ export const installMockRoutes = async (page: Page, world: MockWorld): Promise<v
if (entry) {
await route.fulfill({
json: entry.errors ? { errors: entry.errors } : { data: entry.data },
json: {
...(entry.data === undefined ? {} : { data: entry.data }),
...(entry.errors ? { errors: entry.errors } : {}),
},
});
return;