refactor: split repo into docs/ mockup/ app/
- move static mockups from resource/ui to mockup/ - move React app scaffold from resource/ui to app/ - move prome.md + images to docs/ - drop empty resource/jsonfile and resource/ - add root .gitignore - rewrite README for new layout - fix paths in mockup/index.html (resource/ui -> mockup, docs/prome.md)
This commit is contained in:
1 parent
8e87e47017
commit
92a2adad6a
133 files changed
+23416
-50
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const executeRequest = vi.fn();
|
||||
|
||||
vi.mock("@agent-native/core/provider-api", () => ({
|
||||
createProviderApiRuntime: () => ({ executeRequest }),
|
||||
}));
|
||||
|
||||
const { default: action, requiresProviderApiApproval } =
|
||||
await import("./provider-api-request");
|
||||
|
||||
describe("provider-api-request", () => {
|
||||
beforeEach(() => {
|
||||
executeRequest.mockReset();
|
||||
});
|
||||
|
||||
it("routes Slack reads through the shared provider runtime", async () => {
|
||||
executeRequest.mockResolvedValue({ ok: true, team: "Example" });
|
||||
|
||||
await expect(
|
||||
action.run({ provider: "slack", method: "GET", path: "/auth.test" }),
|
||||
).resolves.toEqual({ ok: true, team: "Example" });
|
||||
expect(executeRequest).toHaveBeenCalledWith({
|
||||
provider: "slack",
|
||||
method: "GET",
|
||||
path: "/auth.test",
|
||||
});
|
||||
});
|
||||
|
||||
it("requires approval for provider writes", () => {
|
||||
expect(requiresProviderApiApproval({ method: "GET" })).toBe(false);
|
||||
expect(requiresProviderApiApproval({ method: "HEAD" })).toBe(false);
|
||||
expect(requiresProviderApiApproval({ method: "POST" })).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user