Update tests

This commit is contained in:
Ashita Prasad
2025-01-12 16:39:33 +05:30
parent 105ef7cf1d
commit f76d520f57
6 changed files with 17 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import 'http_response_models.dart';
final historyMetaModel1 = HistoryMetaModel(
historyId: 'historyId1',
requestId: 'requestId1',
apiType: APIType.rest,
url: 'https://api.apidash.dev/humanize/social',
method: HTTPVerb.get,
timeStamp: DateTime(2024, 1, 1),
@ -26,6 +27,7 @@ final historyRequestModel1 = HistoryRequestModel(
final historyMetaModel2 = HistoryMetaModel(
historyId: 'historyId2',
requestId: 'requestId2',
apiType: APIType.rest,
url: 'https://api.apidash.dev/case/lower',
method: HTTPVerb.post,
timeStamp: DateTime(2024, 1, 1),
@ -43,6 +45,7 @@ final historyRequestModel2 = HistoryRequestModel(
final Map<String, dynamic> historyMetaModelJson1 = {
"historyId": "historyId1",
"requestId": "requestId1",
"apiType": "rest",
"name": "",
"url": "https://api.apidash.dev/humanize/social",
"method": "get",
@ -60,6 +63,7 @@ final Map<String, dynamic> historyRequestModelJson1 = {
final Map<String, dynamic> historyMetaModelJson2 = {
"historyId": "historyId2",
"requestId": "requestId2",
"apiType": "rest",
"name": "",
"url": "https://api.apidash.dev/case/lower",
"method": "post",

View File

@ -388,6 +388,7 @@ const httpRequestModelGet4Json = <String, dynamic>{
"isParamEnabledList": null,
"bodyContentType": "json",
"body": null,
"query": null,
"formData": null
};
@ -408,6 +409,7 @@ const httpRequestModelPost10Json = <String, dynamic>{
"body": '''{
"text": "I LOVE Flutter"
}''',
"query": null,
'formData': [
{'name': 'token', 'value': 'xyz', 'type': 'text'},
{'name': 'imfile', 'value': '/Documents/up/1.png', 'type': 'file'}

View File

@ -13,6 +13,7 @@ void main() {
final mockModel = HistoryMetaModel(
historyId: 'historyId',
requestId: 'requestId',
apiType: APIType.rest,
url: 'https://api.apidash.dev',
method: HTTPVerb.get,
timeStamp: DateTime.now(),

View File

@ -11,6 +11,7 @@ void main() {
HistoryMetaModel(
historyId: 'historyId',
requestId: 'requestId',
apiType: APIType.rest,
url: 'https://api.apidash.dev',
method: HTTPVerb.get,
timeStamp: DateTime.now(),
@ -30,6 +31,7 @@ void main() {
SidebarHistoryCard(
id: '1',
models: sampleModels,
apiType: APIType.rest,
method: HTTPVerb.get,
onTap: () {
changedValue = 'Tapped';
@ -68,6 +70,7 @@ void main() {
children: [
SidebarHistoryCard(
id: '1',
apiType: APIType.rest,
models: sampleModels,
method: HTTPVerb.get,
onTap: () {

View File

@ -16,6 +16,7 @@ void main() {
children: [
SidebarRequestCard(
id: '23',
apiType: APIType.rest,
selectedId: '2',
url: 'https://api.apidash.dev',
method: HTTPVerb.get,
@ -61,6 +62,7 @@ void main() {
children: [
SidebarRequestCard(
id: '2',
apiType: APIType.rest,
selectedId: '2',
editRequestId: '2',
url: 'https://api.apidash.dev',

View File

@ -1,3 +1,4 @@
import 'package:apidash/consts.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
@ -28,7 +29,7 @@ void main() {
expect(find.byType(TextFormField), findsOneWidget);
expect(find.byKey(const Key("2")), findsOneWidget);
expect(find.text('Enter content (body)'), findsOneWidget);
expect(find.text(kHintContent), findsOneWidget);
var txtForm = find.byKey(const Key("2"));
await tester.enterText(txtForm, 'entering 123 for testing content body');
await tester.pump();
@ -40,7 +41,7 @@ void main() {
await tester.pump();
await tester.pumpAndSettle();
expect(changedValue, 'entering 123 for testing content body ');
expect(changedValue, 'entering 123 for testing content body ');
});
testWidgets('Testing Editor Dark theme', (tester) async {
dynamic changedValue;
@ -66,7 +67,7 @@ void main() {
expect(find.text('initial'), findsOneWidget);
expect(find.byType(TextFormField), findsOneWidget);
expect(find.byKey(const Key("2")), findsOneWidget);
expect(find.text('Enter content (body)'), findsOneWidget);
expect(find.text(kHintContent), findsOneWidget);
var txtForm = find.byKey(const Key("2"));
await tester.enterText(txtForm, 'entering 123 for testing content body');
await tester.pump();
@ -78,6 +79,6 @@ void main() {
await tester.pump();
await tester.pumpAndSettle();
expect(changedValue, 'entering 123 for testing content body ');
expect(changedValue, 'entering 123 for testing content body ');
});
}