refactor(web): LabelEditor ignores blank labels; revert gratuitous tsconfig ES2022 bump
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,7 @@ test("typing EN and SV emits both labels; empty langs are omitted", async () =>
|
||||
renderApp(<Harness onChange={(v) => seen.push(v)} />);
|
||||
await userEvent.type(screen.getByLabelText(/label \(en\)/i), "Bronze");
|
||||
await userEvent.type(screen.getByLabelText(/label \(sv\)/i), "Brons");
|
||||
const last = seen.at(-1)!;
|
||||
const last = seen[seen.length - 1]!;
|
||||
expect(last).toEqual(
|
||||
expect.arrayContaining([
|
||||
{ lang: "en", label: "Bronze" },
|
||||
|
||||
@@ -21,7 +21,7 @@ export function LabelEditor({
|
||||
const set = (lang: string, label: string) => {
|
||||
const others = value.filter((l) => l.lang !== lang);
|
||||
|
||||
onChange(label ? [...others, { lang, label }] : others);
|
||||
onChange(label.trim() ? [...others, { lang, label }] : others);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user