Skip to content

Commit

Permalink
fix(widgetbook): 🐛 requires directories to be not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshor committed Feb 20, 2023
1 parent 6821f3f commit 8e9b7aa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
5 changes: 1 addition & 4 deletions packages/widgetbook/lib/src/widgetbook.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ class Widgetbook<CustomTheme> extends StatefulWidget {
this.directories = const <MultiChildNavigationNodeData>[],
required this.appBuilder,
required this.addons,
}) : assert(
directories.length > 0,
'Please specify at least one $MultiChildNavigationNodeData.',
);
});

final List<WidgetbookAddOn> addons;

Expand Down
17 changes: 0 additions & 17 deletions packages/widgetbook/test/src/widgetbook_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:go_router/go_router.dart';
import 'package:widgetbook/widgetbook.dart';
import 'package:widgetbook_core/widgetbook_core.dart';

Matcher expectAssertionErrorWithMessage({
required String message,
Expand Down Expand Up @@ -48,22 +47,6 @@ void main() {
group(
'constructor throws $AssertionError when',
() {
test(
'Navigation tree children are empty',
() {
expect(
() => Widgetbook<ThemeData>(
addons: const [],
appBuilder: _defaultAppBuilderMethod,
),
expectAssertionErrorWithMessage(
message:
'Please specify at least one $MultiChildNavigationNodeData.',
),
);
},
);

test(
'devices is empty',
() {
Expand Down

0 comments on commit 8e9b7aa

Please sign in to comment.