如何测试Flutter是否发送了发帖请求?

时间:2019-11-06 18:32:58

标签: flutter-test

尝试测试我的小部件是否发送了发帖请求。

    testWidgets("loads up armo when tapped", (WidgetTester tester) async {
      final scaffoldKey = GlobalKey<ScaffoldState>();

      await tester.pumpWidget(DAR(scaffoldKey));
      await tester.pump();
      expect(find.text('XOX'), findsNothing);
      scaffoldKey.currentState.openDrawer();
      await tester.pump();
      expect(find.text('XOX'), findsOneWidget);
      //tap on XOX
      await tester.tap(find.text('XOX'));
      await tester.pump();

      //Shoot request sent
      //How to test if a post request is sent in flutter?
      //
    });

我希望测试能够检查是否发送了请求。

0 个答案:

没有答案