Skip to content

Commit

Permalink
Adding layout indexes test. #1
Browse files Browse the repository at this point in the history
  • Loading branch information
caduandrade committed Sep 25, 2023
1 parent b85bed9 commit d48c48f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/layout_index_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import 'package:docking/docking.dart';
import 'package:flutter_test/flutter_test.dart';

import 'utils.dart';

void main() {
group('Layout indexes', () {
test('Indexes', () {
DockingItem itemA = dockingItem('a');
DockingItem itemB = dockingItem('b');
DockingItem itemC = dockingItem('c');
DockingItem itemD = dockingItem('d');
DockingItem itemE = dockingItem('e');
DockingRow row = DockingRow([itemB, itemC]);
DockingTabs tabs = DockingTabs([itemD, itemE]);
DockingColumn column = DockingColumn([itemA, row, tabs]);
DockingLayout layout = DockingLayout(root: column);
expect(column.index, 1);
expect(itemA.index, 2);
expect(row.index, 3);
expect(itemB.index, 4);
expect(itemC.index, 5);
expect(tabs.index, 6);
expect(itemD.index, 7);
expect(itemE.index, 8);
expect(layout.hierarchy(indexInfo: true), 'C1(I2,R3(I4,I5),T6(I7,I8))');
});
});
}

0 comments on commit d48c48f

Please sign in to comment.