Revert "test refactor"

This reverts commit 59b1a3eba63928b8f0123f3b169cdf7a68dc735a.
This commit is contained in:
Ashita Prasad
2024-01-26 23:01:31 +05:30
parent 4afb15f628
commit 61dcff09da

View File

@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:apidash/widgets/editor.dart'; import 'package:apidash/widgets/editor.dart';
import 'package:json_text_field/json_text_field.dart';
import '../test_consts.dart'; import '../test_consts.dart';
void main() { void main() {
@ -27,10 +26,11 @@ void main() {
), ),
); );
expect(find.byType(JsonTextField), findsOneWidget); expect(find.byType(TextFormField), findsOneWidget);
expect(find.byKey(const Key("2")), findsOneWidget); expect(find.byKey(const Key("2")), findsOneWidget);
expect(find.text('Enter content (body)'), findsOneWidget); expect(find.text('Enter content (body)'), findsOneWidget);
var txtForm = find.byKey(const Key("2")).first; var txtForm = find.byKey(const Key("2"));
await tester.enterText(txtForm, 'entering 123 for testing content body');
await tester.pump(); await tester.pump();
await tester.pumpAndSettle(); await tester.pumpAndSettle();
@ -40,7 +40,7 @@ void main() {
await tester.pump(); await tester.pump();
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(changedValue, ' '); expect(changedValue, 'entering 123 for testing content body ');
}); });
testWidgets('Testing Editor Dark theme', (tester) async { testWidgets('Testing Editor Dark theme', (tester) async {
dynamic changedValue; dynamic changedValue;
@ -63,10 +63,12 @@ void main() {
), ),
), ),
); );
expect(find.byType(JsonTextField), findsOneWidget); expect(find.text('initial'), findsOneWidget);
expect(find.byType(TextFormField), findsOneWidget);
expect(find.byKey(const Key("2")), findsOneWidget); expect(find.byKey(const Key("2")), findsOneWidget);
expect(find.text('Enter content (body)'), findsOneWidget); expect(find.text('Enter content (body)'), findsOneWidget);
var txtForm = find.byKey(const Key("2")); var txtForm = find.byKey(const Key("2"));
await tester.enterText(txtForm, 'entering 123 for testing content body');
await tester.pump(); await tester.pump();
await tester.pumpAndSettle(); await tester.pumpAndSettle();
@ -76,6 +78,6 @@ void main() {
await tester.pump(); await tester.pump();
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(changedValue, 'initial '); expect(changedValue, 'entering 123 for testing content body ');
}); });
} }