Skip to content

Commit aecac76

Browse files
committed
fix(combobox-web): address review comments
- Split "loading or unavailable" test cases into separate loading and unavailable variants to make coverage explicit - Add changelog entry for the attribute-presence bug that bypassed custom editability conditions
1 parent c752bbb commit aecac76

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

packages/pluggableWidgets/combobox-web/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1212

1313
- We fixed an issue where the editability setting was inverted: setting editability to `false` allowed editing, and setting it to `true` prevented editing.
1414

15+
- We fixed an issue where the custom editability condition (`never` or `conditionally`) was ignored when the combobox attribute was present and editable.
16+
1517
## [2.8.1] - 2026-04-30
1618

1719
### Fixed

packages/pluggableWidgets/combobox-web/src/helpers/Database/__tests__/utils.spec.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe("getReadonly", () => {
9191
expect(result).toBe(false);
9292
});
9393

94-
it("is read-only when customEditability is 'conditionally' and expression value is undefined (loading or unavailable)", () => {
94+
it("is read-only when customEditability is 'conditionally' and expression is loading", () => {
9595
const targetAttribute = new EditableValueBuilder<string>().withValue("value").build();
9696

9797
const result = getReadonly(
@@ -102,6 +102,18 @@ describe("getReadonly", () => {
102102

103103
expect(result).toBe(true);
104104
});
105+
106+
it("is read-only when customEditability is 'conditionally' and expression is unavailable", () => {
107+
const targetAttribute = new EditableValueBuilder<string>().withValue("value").build();
108+
109+
const result = getReadonly(
110+
targetAttribute as unknown as EditableValue<string | Big>,
111+
"conditionally",
112+
dynamic.unavailable()
113+
);
114+
115+
expect(result).toBe(true);
116+
});
105117
});
106118

107119
describe("when targetAttribute is undefined", () => {
@@ -129,10 +141,16 @@ describe("getReadonly", () => {
129141
expect(result).toBe(false);
130142
});
131143

132-
it("is read-only when customEditability is 'conditionally' and expression value is undefined (loading or unavailable)", () => {
144+
it("is read-only when customEditability is 'conditionally' and expression is loading", () => {
133145
const result = getReadonly(undefined, "conditionally", dynamic.loading());
134146

135147
expect(result).toBe(true);
136148
});
149+
150+
it("is read-only when customEditability is 'conditionally' and expression is unavailable", () => {
151+
const result = getReadonly(undefined, "conditionally", dynamic.unavailable());
152+
153+
expect(result).toBe(true);
154+
});
137155
});
138156
});

0 commit comments

Comments
 (0)