feat(KB-652): add openai-codex provider alias
- Add 'openai-codex' provider alias mapped to OpenAI icon with green color (#10a37f) - ProviderIcon component now recognizes openai-codex as valid provider - Add comprehensive test coverage for openai-codex provider icon rendering - Tests cover icon presence, accessibility label, color styling, and SVG fill attributes
This commit is contained in:
@@ -97,6 +97,7 @@ const providerConfig: Record<
|
||||
> = {
|
||||
anthropic: { component: AnthropicIcon, color: "#d4a27f" }, // warm tan
|
||||
openai: { component: OpenAIIcon, color: "#10a37f" }, // green
|
||||
"openai-codex": { component: OpenAIIcon, color: "#10a37f" }, // green (same as openai)
|
||||
google: { component: GeminiIcon, color: "#4285f4" }, // blue
|
||||
gemini: { component: GeminiIcon, color: "#4285f4" }, // blue (same as google)
|
||||
ollama: { component: OllamaIcon, color: "#fff" }, // white
|
||||
|
||||
@@ -15,6 +15,12 @@ describe("ProviderIcon", () => {
|
||||
expect(screen.getByLabelText("OpenAI")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders OpenAI brand icon for openai-codex provider", () => {
|
||||
render(<ProviderIcon provider="openai-codex" />);
|
||||
expect(screen.getByTestId("openai-icon")).toBeInTheDocument();
|
||||
expect(screen.getByLabelText("OpenAI")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders Gemini brand icon for google provider", () => {
|
||||
render(<ProviderIcon provider="google" />);
|
||||
expect(screen.getByTestId("gemini-icon")).toBeInTheDocument();
|
||||
@@ -71,6 +77,12 @@ describe("ProviderIcon", () => {
|
||||
expect(icon).toHaveStyle({ color: "#10a37f" });
|
||||
});
|
||||
|
||||
it("applies provider-specific color for openai-codex", () => {
|
||||
render(<ProviderIcon provider="openai-codex" />);
|
||||
const icon = screen.getByTestId("openai-icon").parentElement;
|
||||
expect(icon).toHaveStyle({ color: "#10a37f" });
|
||||
});
|
||||
|
||||
it("applies provider-specific color for google", () => {
|
||||
render(<ProviderIcon provider="google" />);
|
||||
const icon = screen.getByTestId("gemini-icon").parentElement;
|
||||
@@ -147,6 +159,14 @@ describe("ProviderIcon", () => {
|
||||
expect(paths[0]).toHaveAttribute("fill", "#10a37f");
|
||||
});
|
||||
|
||||
it("passes correct color to SVG fill for openai-codex", () => {
|
||||
render(<ProviderIcon provider="openai-codex" />);
|
||||
const svg = screen.getByTestId("openai-icon");
|
||||
const paths = svg.querySelectorAll("path");
|
||||
expect(paths.length).toBeGreaterThan(0);
|
||||
expect(paths[0]).toHaveAttribute("fill", "#10a37f");
|
||||
});
|
||||
|
||||
it("passes correct color to SVG fill for gemini", () => {
|
||||
render(<ProviderIcon provider="gemini" />);
|
||||
const svg = screen.getByTestId("gemini-icon");
|
||||
|
||||
Reference in New Issue
Block a user