Skip to content

Commit

Permalink
fix(cat-voices): unit tests for status indicator (#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtscalac authored Oct 4, 2024
1 parent 5ffdfe2 commit d3346f9
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ void main() {
const body = 'You can now use your QR-code to login into Catalyst.';

const colors = VoicesColorScheme.optional(
successContainer: Colors.green,
success: Colors.green,
successContainer: Colors.greenAccent,
);

// Act
Expand All @@ -38,7 +39,7 @@ void main() {
tester.firstWidget(find.byType(Container)) as Container;
expect(
(container.decoration! as BoxDecoration).color,
equals(colors.successContainer),
equals(colors.success),
);
},
);
Expand All @@ -52,13 +53,21 @@ void main() {
const body = 'Please try again later.';

const colors = VoicesColorScheme.optional(
errorContainer: Colors.red,
errorContainer: Colors.redAccent,
);

final colorScheme = ColorScheme.fromSeed(
seedColor: Colors.transparent,
error: Colors.red,
);

// Act
await tester.pumpWidget(
MaterialApp(
theme: ThemeData(extensions: const [colors]),
theme: ThemeData(
extensions: const [colors],
colorScheme: colorScheme,
),
home: const VoicesStatusIndicator(
status: Text(status),
title: Text(title),
Expand All @@ -76,7 +85,7 @@ void main() {
tester.firstWidget(find.byType(Container)) as Container;
expect(
(container.decoration! as BoxDecoration).color,
equals(colors.errorContainer),
equals(colorScheme.error),
);
},
);
Expand Down

0 comments on commit d3346f9

Please sign in to comment.