Skip to content

Commit

Permalink
feat: can use scenarioWidgetBuilder when snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
akaboshinit committed Sep 7, 2024
1 parent f27d55a commit bdff38f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/playbook_snapshot/lib/src/snapshot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Snapshot implements TestTool {
Playbook playbook,
WidgetTester tester,
PlaybookBuilder builder, {
ScenarioWidgetBuilder? scenarioWidgetBuilder,
Future<void> Function(WidgetTester tester)? setUpEachTest,
}) async {
await tester.runAsync(() async {
Expand Down Expand Up @@ -80,6 +81,7 @@ class Snapshot implements TestTool {
checkeredColor: checkeredColor,
checkeredRectSize: checkeredRectSize,
useMaterial: useMaterial,
builder: scenarioWidgetBuilder,
scenario: scenario,
),
device,
Expand Down
3 changes: 3 additions & 0 deletions packages/playbook_snapshot/lib/src/test_tool.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ abstract class TestTool {
Playbook playbook,
WidgetTester tester,
PlaybookBuilder builder, {
ScenarioWidgetBuilder? scenarioWidgetBuilder,
Future<void> Function(WidgetTester tester)? setUpEachTest,
});
}
Expand All @@ -19,12 +20,14 @@ extension PlaybookExt on Playbook {
TestTool test,
WidgetTester tester,
PlaybookBuilder builder, {
ScenarioWidgetBuilder? scenarioWidgetBuilder,
Future<void> Function(WidgetTester tester)? setUpEachTest,
}) async {
await test.run(
this,
tester,
builder,
scenarioWidgetBuilder: scenarioWidgetBuilder,
setUpEachTest: setUpEachTest,
);
}
Expand Down

0 comments on commit bdff38f

Please sign in to comment.