2026-02-14 14:32:54 +00:00
|
|
|
/// <reference types="cypress" />
|
|
|
|
|
|
2026-03-04 22:24:35 +05:30
|
|
|
import { setupCommonPageTestHooks } from "../support/testHooks";
|
|
|
|
|
|
2026-02-14 14:32:54 +00:00
|
|
|
describe("Skill packs", () => {
|
|
|
|
|
const apiBase = "**/api/v1";
|
|
|
|
|
|
2026-03-04 22:24:35 +05:30
|
|
|
setupCommonPageTestHooks(apiBase);
|
2026-02-14 14:32:54 +00:00
|
|
|
|
|
|
|
|
it("can sync a pack and surface warnings", () => {
|
|
|
|
|
cy.intercept("GET", `${apiBase}/skills/packs*`, {
|
|
|
|
|
statusCode: 200,
|
|
|
|
|
body: [
|
|
|
|
|
{
|
|
|
|
|
id: "p1",
|
|
|
|
|
name: "OpenClaw Skills",
|
|
|
|
|
description: "Test pack",
|
|
|
|
|
source_url: "https://github.com/openclaw/skills",
|
|
|
|
|
branch: "main",
|
|
|
|
|
skill_count: 12,
|
|
|
|
|
updated_at: "2026-02-14T00:00:00Z",
|
|
|
|
|
created_at: "2026-02-10T00:00:00Z",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
}).as("packsList");
|
|
|
|
|
|
|
|
|
|
cy.intercept("POST", `${apiBase}/skills/packs/p1/sync*`, {
|
|
|
|
|
statusCode: 200,
|
|
|
|
|
body: {
|
|
|
|
|
warnings: ["1 skill skipped (missing SKILL.md)"],
|
|
|
|
|
},
|
|
|
|
|
}).as("packSync");
|
|
|
|
|
|
2026-03-04 22:29:47 +05:30
|
|
|
cy.loginWithLocalAuth();
|
2026-02-14 14:32:54 +00:00
|
|
|
cy.visit("/skills/packs");
|
|
|
|
|
cy.waitForAppLoaded();
|
|
|
|
|
|
2026-03-04 22:29:47 +05:30
|
|
|
cy.wait(["@usersMe", "@organizationsList", "@orgMeMember", "@packsList"], {
|
|
|
|
|
timeout: 20_000,
|
|
|
|
|
});
|
2026-02-14 14:32:54 +00:00
|
|
|
cy.contains(/openclaw skills/i).should("be.visible");
|
|
|
|
|
|
|
|
|
|
cy.contains("button", /^sync$/i).click();
|
|
|
|
|
cy.wait("@packSync", { timeout: 20_000 });
|
|
|
|
|
|
|
|
|
|
cy.contains(/skill skipped/i).should("be.visible");
|
|
|
|
|
});
|
|
|
|
|
});
|