diff --git a/test/goldens/icon_button.dark.png b/test/goldens/icon_button.dark.png new file mode 100644 index 0000000..0f18f64 Binary files /dev/null and b/test/goldens/icon_button.dark.png differ diff --git a/test/goldens/icon_button.light.png b/test/goldens/icon_button.light.png new file mode 100644 index 0000000..10bce12 Binary files /dev/null and b/test/goldens/icon_button.light.png differ diff --git a/test/goldens/primary_button.dark.png b/test/goldens/primary_button.dark.png new file mode 100644 index 0000000..c5ac5bd Binary files /dev/null and b/test/goldens/primary_button.dark.png differ diff --git a/test/goldens/primary_button.light.png b/test/goldens/primary_button.light.png new file mode 100644 index 0000000..3ae7e58 Binary files /dev/null and b/test/goldens/primary_button.light.png differ diff --git a/test/goldens/secondary_button.dark.png b/test/goldens/secondary_button.dark.png new file mode 100644 index 0000000..77d39b8 Binary files /dev/null and b/test/goldens/secondary_button.dark.png differ diff --git a/test/goldens/secondary_button.light.png b/test/goldens/secondary_button.light.png new file mode 100644 index 0000000..1c4516d Binary files /dev/null and b/test/goldens/secondary_button.light.png differ diff --git a/test/goldens/tertiary_button.dark.png b/test/goldens/tertiary_button.dark.png new file mode 100644 index 0000000..ae6d93c Binary files /dev/null and b/test/goldens/tertiary_button.dark.png differ diff --git a/test/goldens/tertiary_button.light.png b/test/goldens/tertiary_button.light.png new file mode 100644 index 0000000..7c2ea0e Binary files /dev/null and b/test/goldens/tertiary_button.light.png differ diff --git a/test/sbb_icon_button_test.dart b/test/sbb_icon_button_test.dart new file mode 100644 index 0000000..ec5c53a --- /dev/null +++ b/test/sbb_icon_button_test.dart @@ -0,0 +1,32 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:sbb_design_system_mobile/sbb_design_system_mobile.dart'; + +import 'test_app.dart'; + +void main() { + testWidgets('icon_button', (WidgetTester tester) async { + final widget = Padding( + padding: const EdgeInsets.symmetric(horizontal: sbbDefaultSpacing / 2), + child: Column( + children: [ + const SizedBox(height: sbbDefaultSpacing), + SBBIconButtonLarge(onPressed: () {}, icon: SBBIcons.glass_cocktail_medium), + const SizedBox(height: sbbDefaultSpacing), + SBBIconButtonLarge(onPressed: null, icon: SBBIcons.glass_cocktail_medium), + const SizedBox(height: sbbDefaultSpacing), + SBBIconButtonSmall(onPressed: () {}, icon: SBBIcons.glass_cocktail_small), + const SizedBox(height: sbbDefaultSpacing), + SBBIconButtonSmall(onPressed: null, icon: SBBIcons.glass_cocktail_small), + ], + ), + ); + await TestSpecs.run( + TestSpecs.themedSpecs, + widget, + tester, + 'icon_button', + find.byType(Column).first, + ); + }); +} diff --git a/test/sbb_primary_button_test.dart b/test/sbb_primary_button_test.dart new file mode 100644 index 0000000..b7c15a8 --- /dev/null +++ b/test/sbb_primary_button_test.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:sbb_design_system_mobile/sbb_design_system_mobile.dart'; + +import 'test_app.dart'; + +void main() { + testWidgets('primary_button', (WidgetTester tester) async { + final widget = Padding( + padding: const EdgeInsets.symmetric(horizontal: sbbDefaultSpacing / 2), + child: Column( + children: [ + const SizedBox(height: sbbDefaultSpacing), + SBBPrimaryButton(label: "Default", onPressed: () {}), + const SizedBox(height: sbbDefaultSpacing), + SBBPrimaryButton(label: "Disabled", onPressed: null), + ], + ), + ); + await TestSpecs.run( + TestSpecs.themedSpecs, + widget, + tester, + 'primary_button', + find.byType(Column).first, + ); + }); +} diff --git a/test/sbb_secondary_button_test.dart b/test/sbb_secondary_button_test.dart new file mode 100644 index 0000000..8fbfbe3 --- /dev/null +++ b/test/sbb_secondary_button_test.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:sbb_design_system_mobile/sbb_design_system_mobile.dart'; + +import 'test_app.dart'; + +void main() { + testWidgets('secondary_button', (WidgetTester tester) async { + final widget = Padding( + padding: const EdgeInsets.symmetric(horizontal: sbbDefaultSpacing / 2), + + child: Column( + children: [ + const SizedBox(height: sbbDefaultSpacing), + SBBSecondaryButton(label: "Default", onPressed: () {}), + const SizedBox(height: sbbDefaultSpacing), + SBBSecondaryButton(label: "Disabled", onPressed: null), + ], + ), + ); + await TestSpecs.run( + TestSpecs.themedSpecs, + widget, + tester, + 'secondary_button', + find.byType(Column).first, + ); + }); +} diff --git a/test/sbb_tertiary_button_test.dart b/test/sbb_tertiary_button_test.dart new file mode 100644 index 0000000..8feae94 --- /dev/null +++ b/test/sbb_tertiary_button_test.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:sbb_design_system_mobile/sbb_design_system_mobile.dart'; + +import 'test_app.dart'; + +void main() { + testWidgets('tertiary_button', (WidgetTester tester) async { + final widget = Padding( + padding: const EdgeInsets.symmetric(horizontal: sbbDefaultSpacing / 2), + child: Column( + children: [ + const SizedBox(height: sbbDefaultSpacing), + SBBTertiaryButtonLarge(label: "Default", onPressed: () {}), + const SizedBox(height: sbbDefaultSpacing), + SBBTertiaryButtonLarge(label: "Disabled", onPressed: null), + const SizedBox(height: sbbDefaultSpacing), + SBBTertiaryButtonLarge(label: "Icon", onPressed: () {}, icon: SBBIcons.dog_medium), + const SizedBox(height: sbbDefaultSpacing), + SBBTertiaryButtonLarge(label: "Icon Disabled", onPressed: null, icon: SBBIcons.dog_medium), + const SizedBox(height: sbbDefaultSpacing), + SBBTertiaryButtonSmall(label: "Default", onPressed: () {}), + const SizedBox(height: sbbDefaultSpacing), + SBBTertiaryButtonSmall(label: "Disabled", onPressed: null), + const SizedBox(height: sbbDefaultSpacing), + SBBTertiaryButtonSmall(label: "Icon", onPressed: () {}, icon: SBBIcons.dog_small), + const SizedBox(height: sbbDefaultSpacing), + SBBTertiaryButtonSmall(label: "Icon Disabled", onPressed: null, icon: SBBIcons.dog_small), + ], + ), + ); + await TestSpecs.run( + TestSpecs.themedSpecs, + widget, + tester, + 'tertiary_button', + find.byType(Column).first, + ); + }); +}