mirror of
https://github.com/foss42/apidash.git
synced 2025-06-03 08:16:25 +08:00
Create splitviews_test.dart
This commit is contained in:
42
test/widgets/splitviews_test.dart
Normal file
42
test/widgets/splitviews_test.dart
Normal file
@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:apidash/widgets/splitviews.dart';
|
||||
import 'package:multi_split_view/multi_split_view.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Testing for Dashboard Splitview', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
title: 'Dashboard Splitview',
|
||||
home: Scaffold(
|
||||
body: DashboardSplitView(
|
||||
sidebarWidget: Column(children: const [Text("Hello")]),
|
||||
mainWidget: Column(children: const [Text("World")]),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.text("World"), findsOneWidget);
|
||||
expect(find.text("Hello"), findsOneWidget);
|
||||
expect(find.byType(MultiSplitViewTheme), findsOneWidget);
|
||||
});
|
||||
testWidgets('Testing for Equal SplitView', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
title: 'Equal SplitView',
|
||||
home: Scaffold(
|
||||
body: EqualSplitView(
|
||||
leftWidget: Column(children: const [Text("Hello equal")]),
|
||||
rightWidget: Column(children: const [Text("World equal")]),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.text("World equal"), findsOneWidget);
|
||||
expect(find.text("Hello equal"), findsOneWidget);
|
||||
expect(find.byType(MultiSplitViewTheme), findsOneWidget);
|
||||
});
|
||||
//TODO: Divider not visible on flutter run. Investigate.
|
||||
}
|
Reference in New Issue
Block a user