Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
chore" fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RuiMiguel committed Nov 22, 2023
1 parent bb43f55 commit 29ff973
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lib/home/widgets/logo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Logo extends StatelessWidget {
),
),
const SizedBox(width: 4),
VertexIcons.asterisk.image(),
vertexIcons.asterisk.image(),
const SizedBox(width: 4),
Text(
l10n.flutter,
Expand Down
2 changes: 1 addition & 1 deletion lib/home/widgets/welcome_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class WelcomeView extends StatelessWidget {
),
const SizedBox(height: 40),
CTAButton(
icon: VertexIcons.arrowForward.image(),
icon: vertexIcons.arrowForward.image(),
label: l10n.startAsking,
),
],
Expand Down
3 changes: 1 addition & 2 deletions packages/app_ui/lib/app_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ import 'package:app_ui/src/generated/assets.gen.dart';
export 'src/widgets/widgets.dart';

/// Global reference to actual app_ui icons.
// ignore: constant_identifier_names
const VertexIcons = Assets.icons;
const vertexIcons = Assets.icons;
1 change: 1 addition & 0 deletions packages/app_ui/test/src/helpers/helpers.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export 'pump_app.dart';
12 changes: 12 additions & 0 deletions packages/app_ui/test/src/helpers/pump_app.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

extension PumpApp on WidgetTester {
Future<void> pumpApp(Widget widget) {
return pumpWidget(
MaterialApp(
home: widget,
),
);
}
}
34 changes: 13 additions & 21 deletions packages/app_ui/test/src/widgets/cta_button_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,15 @@ import 'package:app_ui/src/generated/assets.gen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import '../helpers/helpers.dart';

void main() {
group('CTAButton', () {
Widget bootstrap({
required Widget child,
}) {
return MaterialApp(home: child);
}

testWidgets('renders correctly', (tester) async {
await tester.pumpWidget(
bootstrap(
child: CTAButton(
icon: Assets.icons.arrowForward.image(),
label: 'label',
),
await tester.pumpApp(
CTAButton(
icon: Assets.icons.arrowForward.image(),
label: 'label',
),
);

Expand All @@ -27,15 +21,13 @@ void main() {
testWidgets('calls onPressed when tap', (tester) async {
var called = false;

await tester.pumpWidget(
bootstrap(
child: CTAButton(
icon: Assets.icons.arrowForward.image(),
label: 'label',
onPressed: () {
called = true;
},
),
await tester.pumpApp(
CTAButton(
icon: Assets.icons.arrowForward.image(),
label: 'label',
onPressed: () {
called = true;
},
),
);

Expand Down

0 comments on commit 29ff973

Please sign in to comment.