Skip to content

Commit

Permalink
add test case for initialActiveIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
avenwu committed Feb 12, 2020
1 parent fada4ed commit 9621829
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ void main() {
TabItem(title: 'Tab B', icon: Icons.near_me),
TabItem(title: 'Tab C', icon: Icons.web),
],
initialActiveIndex: 2,
style: TabStyle.fixed,
)));
final tabAText = find.text('Tab A');
Expand Down Expand Up @@ -176,6 +177,21 @@ void main() {
await tester.tap(find.text('TAB 1'));
await tester.pumpAndSettle(Duration(milliseconds: 300));
});

test('test invalid builder', () {
try {
ConvexAppBar.builder(
itemBuilder: null,
count: 3,
top: -20,
onTap: (i) {
assert(i == 1);
},
);
} catch (e) {
assert(true, e.toString().contains('provide custom buidler'));
}
});
}

class Builder extends DelegateBuilder {
Expand Down

0 comments on commit 9621829

Please sign in to comment.