2016-12-23 20:57:46 +00:00
|
|
|
import 'package:angel_framework/angel_framework.dart';
|
2017-02-22 22:34:35 +00:00
|
|
|
import 'package:angel_framework/common.dart';
|
2016-12-23 20:57:46 +00:00
|
|
|
import 'package:angel_websocket/base_websocket_client.dart';
|
|
|
|
import 'package:test/test.dart';
|
|
|
|
|
2017-02-22 22:34:35 +00:00
|
|
|
class Todo extends Model {
|
2016-12-23 20:57:46 +00:00
|
|
|
String text;
|
|
|
|
String when;
|
|
|
|
|
|
|
|
Todo({String this.text, String this.when});
|
|
|
|
}
|
|
|
|
|
|
|
|
class TodoService extends MemoryService<Todo> {}
|
|
|
|
|
|
|
|
testIndex(BaseWebSocketClient client) async {
|
|
|
|
var Todos = client.service('api/todos');
|
|
|
|
Todos.index();
|
|
|
|
|
|
|
|
var indexed = await Todos.onIndexed.first;
|
|
|
|
print('indexed: ${indexed.toJson()}');
|
|
|
|
|
|
|
|
expect(indexed.data, isList);
|
|
|
|
expect(indexed.data, isEmpty);
|
|
|
|
}
|