1- // ignore_for_file: avoid_init_to_null
2- import 'package:flutter_test/flutter_test.dart' ;
3- import 'package:flutter_feathersjs/flutter_feathersjs.dart' ;
4- import 'fixtures.dart' ;
5- import 'package:socket_io_client/socket_io_client.dart' as IO;
1+ // // ignore_for_file: avoid_init_to_null
2+ // import 'package:flutter_test/flutter_test.dart';
3+ // import 'package:flutter_feathersjs/flutter_feathersjs.dart';
4+ // import 'fixtures.dart';
5+ // import 'package:socket_io_client/socket_io_client.dart' as IO;
66
7- void main () async {
8- var idToGet = null ;
9- var idToDelete = null ;
10- var idToUpdate = null ;
7+ // void main() async {
8+ // var idToGet = null;
9+ // var idToDelete = null;
10+ // var idToUpdate = null;
1111
12- var messages = [
13- {"text" : "Message to delete" },
14- {"text" : "Message to update" },
15- {"text" : "Message to get" },
16- ];
12+ // var messages = [
13+ // {"text": "Message to delete"},
14+ // {"text": "Message to update"},
15+ // {"text": "Message to get"},
16+ // ];
1717
18- FlutterFeathersjs client = FlutterFeathersjs ();
18+ // FlutterFeathersjs client = FlutterFeathersjs();
1919
2020
21- //2.1. Socket.io client
22- IO .Socket io = IO .io (BASE_URL ,
23- {
24- 'transports' : ['websocket' ],
25- 'extraHeaders' : {
26- 'auth-demo' : authDemo,
27- },
28- 'autoConnect' :
29- true , // Socketio will reconnect automatically when connection is lost
30- }
31- );
32-
33-
34- client.configure (FlutterFeathersjs .socketioClient (io));
35-
36-
37-
38- /// ----------- Authentication -------------
39- test (' \n ### Authenticate user using default client \n ' , () async {
40- var response = await client.authenticate (
41- userNameFieldName: 'email' ,
42- strategy: "local" ,
43- userName: user["email" ],
44- password: user["password" ]);
21+ // //2.1. Socket.io client
22+ // IO.Socket io = IO.io(BASE_URL,
23+ // {
24+ // 'transports': ['websocket'],
25+ // 'extraHeaders': {
26+ // 'auth-demo': authDemo,
27+ // },
28+ // 'autoConnect':
29+ // true, // Socketio will reconnect automatically when connection is lost
30+ // }
31+ // );
32+
33+
34+ // client.configure(FlutterFeathersjs.socketioClient(io));
35+
36+
37+
38+ // /// ----------- Authentication -------------
39+ // test(' \n ### Authenticate user using default client \n ', () async {
40+ // var response = await client.authenticate(
41+ // userNameFieldName: 'email',
42+ // strategy: "local",
43+ // userName: user["email"],
44+ // password: user["password"]);
4545
46- expect (response["email" ], equals (user['email' ]));
47- });
48-
49- /// Test "message" service creation
50- /// The created message will be deleted in the end of the test
51- test (' \n ### Create a message[for deletion] using rest standalone \n ' ,
52- () async {
53- var response =
54- await client.service ('message' ).create ({"text" : messages[0 ]["text" ]});
55- idToDelete = response['_id' ];
46+ // expect(response["email"], equals(user['email']));
47+ // });
48+
49+ // /// Test "message" service creation
50+ // /// The created message will be deleted in the end of the test
51+ // test(' \n ### Create a message[for deletion] using rest standalone \n ',
52+ // () async {
53+ // var response =
54+ // await client.service('message').create({"text": messages[0]["text"]});
55+ // idToDelete = response['_id'];
5656
57- expect (response["text" ], equals (messages[0 ]["text" ]));
58- });
59-
60- /// Test "message" service creation
61- /// The created message will be deleted in the end of the test
62- test (' \n Create a message[for update] using rest standalone \n ' , () async {
63- var response =
64- await client.service ('message' ).create ({"text" : messages[1 ]["text" ]});
57+ // expect(response["text"], equals(messages[0]["text"]));
58+ // });
59+
60+ // /// Test "message" service creation
61+ // /// The created message will be deleted in the end of the test
62+ // test(' \n Create a message[for update] using rest standalone \n ', () async {
63+ // var response =
64+ // await client.service('message').create({"text": messages[1]["text"]});
6565
66- idToUpdate = response['_id' ];
66+ // idToUpdate = response['_id'];
6767
68- expect (response["text" ], equals (messages[1 ]["text" ]));
69- });
68+ // expect(response["text"], equals(messages[1]["text"]));
69+ // });
7070
71- /// Test "message" service creation
72- /// The created message will be deleted in the end of the test
73- test (' \n Create a message[for get] using rest standalone \n ' , () async {
74- var response =
75- await client.service ('message' ).create ({"text" : messages[2 ]["text" ]});
71+ // /// Test "message" service creation
72+ // /// The created message will be deleted in the end of the test
73+ // test(' \n Create a message[for get] using rest standalone \n ', () async {
74+ // var response =
75+ // await client.service('message').create({"text": messages[2]["text"]});
7676
77- idToGet = response['_id' ];
77+ // idToGet = response['_id'];
7878
79- expect (response["text" ], equals (messages[2 ]["text" ]));
80- });
79+ // expect(response["text"], equals(messages[2]["text"]));
80+ // });
8181
82- // delete message
83- test (' \n Deleting $idToDelete using rest standalone \n ' , () async {
84- var response = await client.service ('message' ).remove (idToDelete);
82+ // // delete message
83+ // test(' \n Deleting $idToDelete using rest standalone \n ', () async {
84+ // var response = await client.service('message').remove(idToDelete);
8585
86- expect (response["text" ], equals (messages[0 ]["text" ]));
87- });
86+ // expect(response["text"], equals(messages[0]["text"]));
87+ // });
8888
89- // update message
90- test (' \n Updating $idToUpdate using rest standalone \n ' , () async {
91- var response = await client
92- .service ('message' )
93- .patch (idToUpdate, {"text" : "${messages [1 ]["text" ]} updated" });
89+ // // update message
90+ // test(' \n Updating $idToUpdate using rest standalone \n ', () async {
91+ // var response = await client
92+ // .service('message')
93+ // .patch(idToUpdate, {"text": "${messages[1]["text"]} updated"});
9494
95- expect (response["text" ], equals ("${messages [1 ]["text" ]} updated" ));
96- });
95+ // expect(response["text"], equals("${messages[1]["text"]} updated"));
96+ // });
9797
98- // update message
99- test (' \n Getting $idToGet using rest standalone \n ' , () async {
100- var response = await client.service ('message' ).get (idToGet);
98+ // // update message
99+ // test(' \n Getting $idToGet using rest standalone \n ', () async {
100+ // var response = await client.service('message').get(idToGet);
101101
102- expect (response['text' ], equals (messages[2 ]["text" ]));
103- });
102+ // expect(response['text'], equals(messages[2]["text"]));
103+ // });
104104
105- // find message
106- test (' \n Find a message using rest standalone \n ' , () async {
107- var response = await client.service ('message' ).find ({"_id" : idToGet});
105+ // // find message
106+ // test(' \n Find a message using rest standalone \n ', () async {
107+ // var response = await client.service('message').find({"_id": idToGet});
108108
109- expect (response["data" ][0 ]["text" ], equals (messages[2 ]["text" ]));
110- });
111- }
109+ // expect(response["data"][0]["text"], equals(messages[2]["text"]));
110+ // });
111+ // }
112+ void main () async {
113+ }
0 commit comments