mirror of
https://github.com/andrewyng/openworker.git
synced 2026-09-11 06:30:25 +00:00
feat: add Ark provider setup links
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// only the selected method's fields render, and clicking a segment switches them.
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { cleanup, fireEvent, render, screen } from "@testing-library/react";
|
||||
import { ProviderForm, type ProviderSetupState } from "./ProviderSetup";
|
||||
import { KEY_HELP, ProviderForm, ProviderMark, type ProviderSetupState } from "./ProviderSetup";
|
||||
import type { ProviderInfo } from "../api";
|
||||
|
||||
vi.mock("../tauri", () => ({ openExternal: vi.fn() }));
|
||||
@@ -94,3 +94,29 @@ describe("ProviderForm auth-method choice", () => {
|
||||
expect(screen.queryByTestId("t-field-bedrock_api_key")).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("Ark provider presentation", () => {
|
||||
it("uses separate BytePlus and Volcengine brand marks", () => {
|
||||
const { container, rerender } = render(
|
||||
<ProviderMark name="ark" title="BytePlus Ark" />,
|
||||
);
|
||||
expect(container.querySelector("img")).toBeTruthy();
|
||||
|
||||
rerender(
|
||||
<ProviderMark
|
||||
name="ark-agent-plan-cn"
|
||||
title="Volcengine Ark Agent Plan"
|
||||
/>,
|
||||
);
|
||||
expect(container.querySelector("img")).toBeTruthy();
|
||||
});
|
||||
|
||||
it("links each provider to its own API key console", () => {
|
||||
expect(KEY_HELP.ark.url).toBe(
|
||||
"https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey",
|
||||
);
|
||||
expect(KEY_HELP["ark-agent-plan-cn"].url).toContain(
|
||||
"advancedActiveKey=agentPlan",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -21,6 +21,8 @@ export const KEY_HELP: Record<string, { url: string; label: string }> = {
|
||||
anthropic: { url: "https://console.anthropic.com/settings/keys", label: "console.anthropic.com" },
|
||||
openai: { url: "https://platform.openai.com/api-keys", label: "platform.openai.com" },
|
||||
gemini: { url: "https://aistudio.google.com/apikey", label: "aistudio.google.com" },
|
||||
ark: { url: "https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey", label: "console.byteplus.com" },
|
||||
"ark-agent-plan-cn": { url: "https://console.volcengine.com/ark/region:cn-beijing/openManagement?LLM=%7B%7D&advancedActiveKey=agentPlan", label: "console.volcengine.com" },
|
||||
openrouter: { url: "https://openrouter.ai/keys", label: "openrouter.ai" },
|
||||
bedrock: { url: "https://console.aws.amazon.com/bedrock/home#/api-keys", label: "the AWS Bedrock console" },
|
||||
fireworks: { url: "https://fireworks.ai/account/api-keys", label: "fireworks.ai" },
|
||||
|
||||
Reference in New Issue
Block a user