From 3ff9ff235217e73fb720b51906c365d4d5c49321 Mon Sep 17 00:00:00 2001 From: stopflock Date: Mon, 15 Jun 2026 16:30:41 -0500 Subject: [PATCH] fix profile reordering test --- test/models/node_profile_test.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/models/node_profile_test.dart b/test/models/node_profile_test.dart index 64a8cbe..2be313b 100644 --- a/test/models/node_profile_test.dart +++ b/test/models/node_profile_test.dart @@ -221,13 +221,13 @@ void main() { // Initial order should be A, B, C expect(profileState.profiles.map((p) => p.id), equals(['a', 'b', 'c'])); - // Move profile at index 0 (A) to index 2 (should become B, A, C due to Flutter's reorder logic) + // Move profile at index 0 (A) to index 2 (with onReorderItem, newIndex is pre-adjusted) profileState.reorderProfiles(0, 2); - expect(profileState.profiles.map((p) => p.id), equals(['b', 'a', 'c'])); + expect(profileState.profiles.map((p) => p.id), equals(['b', 'c', 'a'])); - // Move profile at index 1 (A) to index 0 (should become A, B, C) + // Move profile at index 1 (C) to index 0 (should become C, B, A) profileState.reorderProfiles(1, 0); - expect(profileState.profiles.map((p) => p.id), equals(['a', 'b', 'c'])); + expect(profileState.profiles.map((p) => p.id), equals(['c', 'b', 'a'])); }); test('should maintain enabled status after reordering', () {