Skip to content

Commit 6de85fe

Browse files
wesbillmanCarl
andauthored
test(mobile): assert follow boundary semantics (#4559)
## Summary - replace a platform-dependent mounted-`RichText` assertion with the production follow-mode boundary predicate - retain the jump-to-latest assertion as the visible consequence of follow mode remaining off - leave production behavior and desktop PR #4549 unchanged ## Why `ScrollablePositionedList` may keep an offscreen item mounted within cache extent on macOS while Linux does not. Mounting therefore does not establish whether reversed-list item 0 is at the latest boundary. The replacement reads the list's public `itemPositionsNotifier` and applies the same `index == 0 && abs(itemLeadingEdge) < 0.01` contract used by `message_list.dart`. ## Validation At commit `bc88617e61d8e9edf8fea832baa8d918163ee212` on macOS with repo Flutter 3.41.7: - `cd mobile && ../bin/flutter test` — 1088 passed, 1 skipped - `cd mobile && ../bin/flutter analyze` — no issues - pre-push `mobile-test` and `branch-skew` hooks — passed Signed-off-by: Wes <[email protected]> Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
1 parent 44fa1e8 commit 6de85fe

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎mobile/test/features/channels/channel_detail_page_test.dart‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,20 @@ void main() {
12941294
]);
12951295
await tester.pumpAndSettle();
12961296

1297-
expect(findRichText('Newest live update'), findsNothing);
1297+
// Cache-extent mounting varies by platform, so assert the reversed
1298+
// list's semantic boundary rather than whether item 0 is mounted.
1299+
final positions = tester
1300+
.widget<ScrollablePositionedList>(messageList)
1301+
.itemPositionsNotifier!
1302+
.itemPositions
1303+
.value;
1304+
expect(
1305+
positions.any(
1306+
(position) =>
1307+
position.index == 0 && position.itemLeadingEdge.abs() < 0.01,
1308+
),
1309+
isFalse,
1310+
);
12981311
expect(
12991312
find.byKey(const ValueKey('channel-jump-to-latest')),
13001313
findsOneWidget,

0 commit comments

Comments
 (0)