Skip to content

Commit 1016454

Browse files
test: remove skill test duplication, replace previous skill tests with const values
1 parent 9a4d5ac commit 1016454

1 file changed

Lines changed: 3 additions & 34 deletions

File tree

src/__tests__/CodexACPAgent/e2e/acp-e2e.test.ts

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -100,40 +100,9 @@ describeE2E("E2E tests", () => {
100100

101101
it("lists a user skill from the CODEX_HOME", async () => {
102102
fixture = await createAuthenticatedFixture();
103-
fixture.writeSkill({
104-
name: "integration-skill",
105-
description: "Integration skill",
106-
body: "This skill exists only for integration testing.",
107-
});
103+
fixture.writeSkill(HELLO_WORLD_SKILL);
108104
const session = await fixture.createSession();
109-
await fixture.expectPromptText(session.sessionId, "/skills", (text) => {
110-
expect(text).toContain("Available skills:");
111-
expect(text).toContain("- integration-skill: Integration skill");
112-
});
113-
});
114-
115-
// Currently, `additionalRoots` are not propagated when listing skills
116-
it.skip("lists skills from additional session roots", async () => {
117-
fixture = await createAuthenticatedFixture();
118-
const additionalSkillsRoot = path.join(fixture.workspaceDir, "custom-skills");
119-
fixture.writeSkill({
120-
name: "session-root-skill",
121-
description: "Session root skill",
122-
body: "This skill exists only in an additional root passed at session creation.",
123-
}, additionalSkillsRoot);
124-
125-
const session = await fixture.connection.newSession({
126-
cwd: fixture.workspaceDir,
127-
mcpServers: [],
128-
_meta: {
129-
additionalRoots: [additionalSkillsRoot],
130-
},
131-
});
132-
133-
await fixture.expectPromptText(session.sessionId, "/skills", (text) => {
134-
expect(text).toContain("Available skills:");
135-
expect(text).toContain("- session-root-skill: Session root skill");
136-
});
105+
await expectHelloSkillListed(fixture, session.sessionId);
137106
});
138107

139108
it("lists a skill from additionalDirectories", async () => {
@@ -168,6 +137,6 @@ async function prepareHelloWorldAdditionalRoot(fixture: SpawnedAgentFixture): Pr
168137
async function expectHelloSkillListed(fixture: SpawnedAgentFixture, sessionId: string): Promise<void> {
169138
await fixture.expectPromptText(sessionId, "/skills", (text) => {
170139
expect(text).toContain("Available skills:");
171-
expect(text).toContain("- hello: Use when the user asks for a hello world skill.");
140+
expect(text).toContain(`- ${HELLO_WORLD_SKILL.name}: ${HELLO_WORLD_SKILL.description}`);
172141
});
173142
}

0 commit comments

Comments
 (0)