Skip to content

Commit 78d44d0

Browse files
committed
feature: building tests
1 parent c3d1513 commit 78d44d0

File tree

14 files changed

+357
-98
lines changed

14 files changed

+357
-98
lines changed

Diff for: example/assets/preview_config.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"id": "widgets",
88
"route": "widgets",
99
"builtComponents": {
10-
"./example/lib/catalog/widgets/main_screen.dart": {
11-
"path": "./example/lib/catalog/widgets/main_screen.dart",
10+
"./lib/catalog/widgets/main_screen.dart": {
11+
"path": "./lib/catalog/widgets/main_screen.dart",
1212
"route": "widgets",
1313
"package": "package:example/catalog/widgets/main_screen.dart",
1414
"clazzName": "MainScreenPreviewPreviewPageDummy",
@@ -35,8 +35,8 @@
3535
"id": "bottom",
3636
"route": "widgets/utils/bottom",
3737
"builtComponents": {
38-
"./example/lib/catalog/widgets/utils/bottom/fab_widget.dart": {
39-
"path": "./example/lib/catalog/widgets/utils/bottom/fab_widget.dart",
38+
"./lib/catalog/widgets/utils/bottom/fab_widget.dart": {
39+
"path": "./lib/catalog/widgets/utils/bottom/fab_widget.dart",
4040
"route": "widgets/utils/bottom",
4141
"package": "package:example/catalog/widgets/utils/bottom/fab_widget.dart",
4242
"clazzName": "FabWidgetPreviewPreviewPageDummy",
@@ -58,8 +58,8 @@
5858
"id": "screen",
5959
"route": "widgets/screen",
6060
"builtComponents": {
61-
"./example/lib/catalog/widgets/screen/body_widget.dart": {
62-
"path": "./example/lib/catalog/widgets/screen/body_widget.dart",
61+
"./lib/catalog/widgets/screen/body_widget.dart": {
62+
"path": "./lib/catalog/widgets/screen/body_widget.dart",
6363
"route": "widgets/screen",
6464
"package": "package:example/catalog/widgets/screen/body_widget.dart",
6565
"clazzName": "BodyWidgetPreviewPreviewPageDummy",
@@ -73,8 +73,8 @@
7373
]
7474
}
7575
},
76-
"./example/lib/catalog/widgets/screen/counter_widget.dart": {
77-
"path": "./example/lib/catalog/widgets/screen/counter_widget.dart",
76+
"./lib/catalog/widgets/screen/counter_widget.dart": {
77+
"path": "./lib/catalog/widgets/screen/counter_widget.dart",
7878
"route": "widgets/screen",
7979
"package": "package:example/catalog/widgets/screen/counter_widget.dart",
8080
"clazzName": "CounterWidgetPreviewPreviewPageDummy",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/// AUTOGENERATED FILE. DO NOT EDIT
2+
3+
import 'package:example/widgets/utils/bottom/catalog/integration_test/fab_widget_integration_test.dart'
4+
as zcch;
5+
import 'package:example/widgets/screen/catalog/integration_test/body_widget_integration_test.dart'
6+
as uetd;
7+
import 'package:example/widgets/screen/catalog/integration_test/counter_widget_integration_test.dart'
8+
as uoui;
9+
import 'package:example/widgets/catalog/integration_test/main_screen_integration_test.dart'
10+
as klxv;
11+
12+
void main() {
13+
zcch.FabWidgetIntegrationTest().main();
14+
uetd.BodyWidgetIntegrationTest().main();
15+
uoui.CounterWidgetIntegrationTest().main();
16+
klxv.MainScreenIntegrationTest().main();
17+
}

Diff for: example/lib/catalog/process.dart

-78
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/// AUTOGENERATED FILE.
2+
///
3+
/// Use this file to test the widget MainScreen
4+
///
5+
6+
import 'package:catalog/catalog.dart';
7+
8+
import '../dummy/main_screen.dummy.dart';
9+
import '../preview/main_screen.preview.dart';
10+
11+
class MainScreenIntegrationTest {
12+
void main() {
13+
group(
14+
'MainScreen - IntegrationTest Tests',
15+
() {
16+
testWidgets(
17+
'Lorem text not found',
18+
(tester) async {
19+
final dummy = MainScreenDummy().dummies.first;
20+
final widget = buildMainScreen(dummy);
21+
await tester.test(widget);
22+
23+
expect(find.text('lorem ipsu'), findsNothing);
24+
},
25+
);
26+
27+
testWidgets(
28+
'Other lorem text not found',
29+
(tester) async {
30+
final dummy = MainScreenDummy().dummies.first;
31+
final widget = buildMainScreen(dummy);
32+
await tester.test(widget);
33+
34+
expect(find.text('ipsu lorem'), findsNothing);
35+
},
36+
);
37+
},
38+
);
39+
}
40+
}
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/// AUTOGENERATED FILE.
2+
///
3+
/// Use this file to test the widget MainScreen
4+
///
5+
6+
import 'package:catalog/catalog.dart';
7+
8+
import '../dummy/main_screen.dummy.dart';
9+
import '../preview/main_screen.preview.dart';
10+
11+
class MainScreenTest {
12+
void main() {
13+
group(
14+
'MainScreen - Tests',
15+
() {
16+
testWidgets(
17+
'Lorem text not found',
18+
(tester) async {
19+
final dummy = MainScreenDummy().dummies.first;
20+
final widget = buildMainScreen(dummy);
21+
await tester.test(widget);
22+
23+
expect(find.text('lorem ipsu'), findsNothing);
24+
},
25+
);
26+
27+
testWidgets(
28+
'Other lorem text not found',
29+
(tester) async {
30+
final dummy = MainScreenDummy().dummies.first;
31+
final widget = buildMainScreen(dummy);
32+
await tester.test(widget);
33+
34+
expect(find.text('ipsu lorem'), findsNothing);
35+
},
36+
);
37+
},
38+
);
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/// AUTOGENERATED FILE.
2+
///
3+
/// Use this file to test the widget BodyWidget
4+
///
5+
6+
import 'package:catalog/catalog.dart';
7+
8+
import '../dummy/body_widget.dummy.dart';
9+
import '../preview/body_widget.preview.dart';
10+
11+
class BodyWidgetIntegrationTest {
12+
void main() {
13+
group(
14+
'BodyWidget - IntegrationTest Tests',
15+
() {
16+
testWidgets(
17+
'Lorem text not found',
18+
(tester) async {
19+
final dummy = BodyWidgetDummy().dummies.first;
20+
final widget = buildBodyWidget(dummy);
21+
await tester.test(widget);
22+
23+
expect(find.text('lorem ipsu'), findsNothing);
24+
},
25+
);
26+
27+
testWidgets(
28+
'Other lorem text not found',
29+
(tester) async {
30+
final dummy = BodyWidgetDummy().dummies.first;
31+
final widget = buildBodyWidget(dummy);
32+
await tester.test(widget);
33+
34+
expect(find.text('ipsu lorem'), findsNothing);
35+
},
36+
);
37+
},
38+
);
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/// AUTOGENERATED FILE.
2+
///
3+
/// Use this file to test the widget CounterWidget
4+
///
5+
6+
import 'package:catalog/catalog.dart';
7+
8+
import '../dummy/counter_widget.dummy.dart';
9+
import '../preview/counter_widget.preview.dart';
10+
11+
class CounterWidgetIntegrationTest {
12+
void main() {
13+
group(
14+
'CounterWidget - IntegrationTest Tests',
15+
() {
16+
testWidgets(
17+
'Lorem text not found',
18+
(tester) async {
19+
final dummy = CounterWidgetDummy().dummies.first;
20+
final widget = buildCounterWidget(dummy);
21+
await tester.test(widget);
22+
23+
expect(find.text('lorem ipsu'), findsNothing);
24+
},
25+
);
26+
27+
testWidgets(
28+
'Other lorem text not found',
29+
(tester) async {
30+
final dummy = CounterWidgetDummy().dummies.first;
31+
final widget = buildCounterWidget(dummy);
32+
await tester.test(widget);
33+
34+
expect(find.text('ipsu lorem'), findsNothing);
35+
},
36+
);
37+
},
38+
);
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/// AUTOGENERATED FILE.
2+
///
3+
/// Use this file to test the widget BodyWidget
4+
///
5+
6+
import 'package:catalog/catalog.dart';
7+
8+
import '../dummy/body_widget.dummy.dart';
9+
import '../preview/body_widget.preview.dart';
10+
11+
class BodyWidgetTest {
12+
void main() {
13+
group(
14+
'BodyWidget - Tests',
15+
() {
16+
testWidgets(
17+
'Lorem text not found',
18+
(tester) async {
19+
final dummy = BodyWidgetDummy().dummies.first;
20+
final widget = buildBodyWidget(dummy);
21+
await tester.test(widget);
22+
23+
expect(find.text('lorem ipsu'), findsNothing);
24+
},
25+
);
26+
27+
testWidgets(
28+
'Other lorem text not found',
29+
(tester) async {
30+
final dummy = BodyWidgetDummy().dummies.first;
31+
final widget = buildBodyWidget(dummy);
32+
await tester.test(widget);
33+
34+
expect(find.text('ipsu lorem'), findsNothing);
35+
},
36+
);
37+
},
38+
);
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/// AUTOGENERATED FILE.
2+
///
3+
/// Use this file to test the widget CounterWidget
4+
///
5+
6+
import 'package:catalog/catalog.dart';
7+
8+
import '../dummy/counter_widget.dummy.dart';
9+
import '../preview/counter_widget.preview.dart';
10+
11+
class CounterWidgetTest {
12+
void main() {
13+
group(
14+
'CounterWidget - Tests',
15+
() {
16+
testWidgets(
17+
'Lorem text not found',
18+
(tester) async {
19+
final dummy = CounterWidgetDummy().dummies.first;
20+
final widget = buildCounterWidget(dummy);
21+
await tester.test(widget);
22+
23+
expect(find.text('lorem ipsu'), findsNothing);
24+
},
25+
);
26+
27+
testWidgets(
28+
'Other lorem text not found',
29+
(tester) async {
30+
final dummy = CounterWidgetDummy().dummies.first;
31+
final widget = buildCounterWidget(dummy);
32+
await tester.test(widget);
33+
34+
expect(find.text('ipsu lorem'), findsNothing);
35+
},
36+
);
37+
},
38+
);
39+
}
40+
}

0 commit comments

Comments
 (0)