Commit 6f68ccd
fix(list-view): read SelectOption.title from full option arg
Follow-up to sc-104554. The chart-list Owner filter regression added
two unit tests in `Select.test.tsx`, both of which failed in CI:
1. `select filter with ReactNode label uses option title when
serializing selection` revealed that `Select.tsx` was reading
`selected.title` from the first argument of antd's `onChange`.
With `labelInValue`, that argument is the `{label, value}`
labeled-value only; the option's `title` lives on the second
argument (the full option). So the title-preferring branch never
ran and the label collapsed to `String(selected.value)` — the
exact bug the fix was supposed to prevent. Read `option?.title`
from the second arg instead.
2. Both new tests asserted `toHaveBeenCalledWith({label, value})` but
`Filters/index.tsx` invokes the prop as
`updateFilterValue(index, option)`. Updated assertions to match
the real signature so the test enforces the intent against
reality, not against a phantom 1-arg shape.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 36cf933 commit 6f68ccd
2 files changed
Lines changed: 12 additions & 9 deletions
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
Lines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | | - | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| |||
0 commit comments