Skip to content

Commit 4e1a03a

Browse files
HanSur94claude
andcommitted
Fix MATLAB E-I shard: update companion toolbar tests for Phase 1040 bell
PR #180 (Phase 1040: Companion Notification Center) added a notification bell to the FastSenseCompanion toolbar, growing it from a 1x9 to a 1x10 grid: the bell was inserted at col 8, pushing the flex spacer 8->9 and the gear 9->10 (all documented in FastSenseCompanion.m). #180 updated TestFastSenseCompanion and TestCompanionEventViewer but missed TestFastSenseCompanionPlantLogToolbar, whose findToolbarGrid_ still matched a 9-column grid and whose assertions still expected the gear at col 9. The grid was never found (verifyNotEmpty failed) and the gear-column check failed, turning MATLAB Tests (E-I) red on main and on every PR that merges with main. Updates the test to the shipped 1x10 layout {110,110,110,130,70,90,70,70,'1x',36}: col 8 = bell (70), col 9 = flex spacer, col 10 = gear (36). Test-only change matching the intentional, self-consistent implementation. Verified 11/11 pass in MATLAB R2020b+ (the two previously-failing methods testToolbarGridIs1x5 + testSettingsButtonMovedToCol5 now green); mlint clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent c58ebb5 commit 4e1a03a

1 file changed

Lines changed: 25 additions & 22 deletions

File tree

tests/suite/TestFastSenseCompanionPlantLogToolbar.m

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,20 @@ function cleanupAll(testCase)
114114
end
115115

116116
function g = findToolbarGrid_(testCase, c) %#ok<INUSL>
117-
% After v3.1 Plant Log + v4.0 Wiki Browser merges, the
118-
% Companion toolbar is a 1x9 grid:
119-
% {110, 110, 110, 130, 70, 90, 70, '1x', 36}
117+
% After v3.1 Plant Log + v4.0 Wiki Browser + v4.0 Phase 1040
118+
% notification bell, the Companion toolbar is a 1x10 grid:
119+
% {110, 110, 110, 130, 70, 90, 70, 70, '1x', 36}
120120
fig = c.getFigForTest_();
121121
grids = findobj(fig, 'Type', 'uigridlayout');
122122
g = [];
123123
for i = 1:numel(grids)
124-
if numel(grids(i).ColumnWidth) == 9
124+
if numel(grids(i).ColumnWidth) == 10
125125
cw = grids(i).ColumnWidth;
126126
if iscell(cw) && isequal(cw{1}, 110) && isequal(cw{2}, 110) && ...
127127
isequal(cw{3}, 110) && isequal(cw{4}, 130) && ...
128128
isequal(cw{5}, 70) && isequal(cw{6}, 90) && ...
129-
isequal(cw{7}, 70) && isequal(cw{9}, 36)
129+
isequal(cw{7}, 70) && isequal(cw{8}, 70) && ...
130+
isequal(cw{10}, 36)
130131
g = grids(i);
131132
return;
132133
end
@@ -139,22 +140,23 @@ function cleanupAll(testCase)
139140
methods (Test)
140141

141142
function testToolbarGridIs1x5(testCase)
142-
% v3.1 Plant Log + v4.0 Wiki Browser merged: toolbar grew from
143-
% 1x4 to 1x9.
144-
% col 1 = Events (110)
145-
% col 2 = Live (110)
146-
% col 3 = Tags (110, v4.0 quick task 260519-bs4)
147-
% col 4 = Plant Log (130, v3.1 Phase 1033 PLOG-INT-03)
148-
% col 5 = Tile ( 70, v4.0 S0Y-01)
149-
% col 6 = Close all ( 90, v4.0 S0Y-02)
150-
% col 7 = Wiki ( 70, v4.0 Phase 1034)
151-
% col 8 = flex spacer
152-
% col 9 = gear ( 36)
143+
% v3.1 Plant Log + v4.0 Wiki Browser + Phase 1040 bell: toolbar
144+
% grew from 1x4 to 1x10.
145+
% col 1 = Events (110)
146+
% col 2 = Live (110)
147+
% col 3 = Tags (110, v4.0 quick task 260519-bs4)
148+
% col 4 = Plant Log (130, v3.1 Phase 1033 PLOG-INT-03)
149+
% col 5 = Tile ( 70, v4.0 S0Y-01)
150+
% col 6 = Close all ( 90, v4.0 S0Y-02)
151+
% col 7 = Wiki ( 70, v4.0 Phase 1034)
152+
% col 8 = Bell ( 70, v4.0 Phase 1040 notification center)
153+
% col 9 = flex spacer
154+
% col 10 = gear ( 36)
153155
d1 = testCase.makeEngine_('A');
154156
c = testCase.makeCompanion_({d1});
155157
g = testCase.findToolbarGrid_(c);
156158
testCase.verifyNotEmpty(g, ...
157-
'toolbar grid (1x8 with ColumnWidth {110 110 110 130 70 90 ''1x'' 36}) must exist');
159+
'toolbar grid (1x10 with ColumnWidth {110 110 110 130 70 90 70 70 ''1x'' 36}) must exist');
158160
cw = g.ColumnWidth;
159161
testCase.verifyEqual(cw{1}, 110, 'ColumnWidth{1} (Events)');
160162
testCase.verifyEqual(cw{2}, 110, 'ColumnWidth{2} (Live)');
@@ -163,8 +165,9 @@ function testToolbarGridIs1x5(testCase)
163165
testCase.verifyEqual(cw{5}, 70, 'ColumnWidth{5} (Tile, v4.0)');
164166
testCase.verifyEqual(cw{6}, 90, 'ColumnWidth{6} (Close all, v4.0)');
165167
testCase.verifyEqual(cw{7}, 70, 'ColumnWidth{7} (Wiki, v4.0 Phase 1034)');
166-
testCase.verifyEqual(cw{8}, '1x', 'ColumnWidth{8} flex spacer');
167-
testCase.verifyEqual(cw{9}, 36, 'ColumnWidth{9} (gear)');
168+
testCase.verifyEqual(cw{8}, 70, 'ColumnWidth{8} (Bell, v4.0 Phase 1040)');
169+
testCase.verifyEqual(cw{9}, '1x', 'ColumnWidth{9} flex spacer');
170+
testCase.verifyEqual(cw{10}, 36, 'ColumnWidth{10} (gear)');
168171
end
169172

170173
function testPlantLogButtonExists(testCase)
@@ -211,13 +214,13 @@ function testPlantLogButtonDisabledWithoutDashboards(testCase)
211214
end
212215

213216
function testSettingsButtonMovedToCol5(testCase)
214-
% After v3.1 + v4.0 merge, gear lives at col 8 (1x8 grid).
217+
% After v3.1 + v4.0 + Phase 1040 bell, gear lives at col 10 (1x10 grid).
215218
d1 = testCase.makeEngine_('A');
216219
c = testCase.makeCompanion_({d1});
217220
gear = findobj(c.getFigForTest_(), 'Tooltip', 'Companion settings');
218221
testCase.verifyNotEmpty(gear);
219-
testCase.verifyEqual(gear.Layout.Column, 9, ...
220-
'settings gear must be at col 9 (1x9 grid post-v3.1+Wiki-Browser merge)');
222+
testCase.verifyEqual(gear.Layout.Column, 10, ...
223+
'settings gear must be at col 10 (1x10 grid post-Phase-1040 bell)');
221224
end
222225

223226
function testFindObjResolvesViaTag(testCase)

0 commit comments

Comments
 (0)