Skip to content

Commit bcb5e4b

Browse files
committed
fix(webview): label codex speed selector
1 parent 4ca5f3e commit bcb5e4b

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

webview-ui/src/components/settings/providers/OpenAICodexSpeedSelector.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,20 @@ interface OpenAICodexSpeedSelectorProps {
1515

1616
export const OpenAICodexSpeedSelector: React.FC<OpenAICodexSpeedSelectorProps> = ({ value, onValueChange }) => {
1717
const { t } = useAppTranslation()
18+
const selectId = React.useId()
1819

1920
return (
2021
<div className="flex flex-col gap-1" data-testid="openai-codex-service-tier">
2122
<div className="flex items-center gap-1">
22-
<label className="block font-medium">{t("settings:openAiCodexSpeed.label")}</label>
23+
<label htmlFor={selectId} className="block font-medium">
24+
{t("settings:openAiCodexSpeed.label")}
25+
</label>
2326
<StandardTooltip content={t("settings:openAiCodexSpeed.tooltip")}>
2427
<i className="codicon codicon-info text-vscode-descriptionForeground text-xs" />
2528
</StandardTooltip>
2629
</div>
2730
<Select value={value ?? OpenAiCodexServiceTier.Default} onValueChange={onValueChange}>
28-
<SelectTrigger className="w-full">
31+
<SelectTrigger id={selectId} className="w-full">
2932
<SelectValue placeholder={t("settings:common.select")} />
3033
</SelectTrigger>
3134
<SelectContent>

webview-ui/src/components/settings/providers/__tests__/OpenAICodex.visual.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ for (const theme of themes) {
2626
test(`renders both OpenAI Codex speeds in the VS Code ${theme.name} theme`, async ({ mount }) => {
2727
const component = await mount(<OpenAICodexFixture />)
2828
const selectors = component.getByTestId("openai-codex-service-tier")
29+
const comboboxes = component.getByRole("combobox", { name: "Speed" })
2930
const selector = selectors.first()
3031

3132
await expect(selectors).toHaveCount(2)
33+
await expect(comboboxes).toHaveCount(2)
3234
await selector.evaluate((element, { bodyClass, themeId }) => {
3335
const { document } = element.ownerDocument.defaultView!
3436

0 commit comments

Comments
 (0)