Skip to content

Commit

Permalink
basic test added for button
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmzdev committed Sep 17, 2024
1 parent 165c06c commit 120a9f0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dev_dependencies:
jaspr_builder: ^0.15.1
jaspr_lints: ^0.1.1
lints: ^3.0.0
jaspr_test: ^0.15.1

jaspr:
mode: static
Expand Down
21 changes: 21 additions & 0 deletions test/components/app_button_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:devfolio/components/app_button.dart';
import 'package:jaspr_test/jaspr_test.dart';

void main() {
testComponents(
'app button default test',
(ComponentTester tester) async {
const label = 'Open google';
await tester.pumpComponent(
AppButton(
label: label,
href: 'https://google.com',
),
);

expect(find.tag('a'), findsOneComponent);
expect(find.tag('span'), findsOneComponent);
expect(find.text(label), findsOneComponent);
},
);
}

0 comments on commit 120a9f0

Please sign in to comment.