Skip to content

Commit

Permalink
add smoke test for ellipse
Browse files Browse the repository at this point in the history
  • Loading branch information
suragch committed Jun 13, 2024
1 parent 4378b92 commit 90bfd30
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions test/shapes/ellipse_golden_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:golden_toolkit/golden_toolkit.dart';
import 'package:swift_ui/swift_ui.dart';

void main() {
group("Shapes > Ellipse >", () {
testGoldens("smoke test", (widgetTester) async {
final builder = GoldenBuilder.grid(columns: 2, widthToHeightRatio: 1)
..addScenario(
'Solid fill',
const Frame(
width: 200,
height: 100,
child: Ellipse(
fillColor: Colors.blue,
),
),
)
..addScenario(
'Gradient fill',
const Frame(
width: 200,
height: 100,
child: Ellipse(
fillGradient: LinearGradient(
colors: [Colors.yellow, Colors.orange],
),
),
),
)
..addScenario(
'Solid stroke',
const Frame(
width: 200,
height: 100,
child: Ellipse(
strokeColor: Colors.blue,
),
),
)
..addScenario(
'Gradient stroke',
const Frame(
width: 200,
height: 100,
child: Ellipse(
strokeGradient: LinearGradient(
colors: [Colors.yellow, Colors.orange],
),
),
),
);
await widgetTester.pumpWidgetBuilder(builder.build());
await screenMatchesGolden(widgetTester, 'ellipse_smoke-test');
});
});
}
Binary file added test/shapes/goldens/ellipse_smoke-test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 90bfd30

Please sign in to comment.