widget_test.dart 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // This is a basic Flutter widget test.
  2. //
  3. // To perform an interaction with a widget in your test, use the WidgetTester
  4. // utility that Flutter provides. For example, you can send tap and scroll
  5. // gestures. You can also use WidgetTester to find child widgets in the widget
  6. // tree, read text, and verify that the values of widget properties are correct.
  7. import 'dart:developer';
  8. import 'package:flutter/material.dart';
  9. import 'package:flutter_test/flutter_test.dart';
  10. import 'package:flutter_desktop_app/main.dart';
  11. import 'package:common_project/utils/net_util/api_util.dart';
  12. import 'dart:convert';
  13. void main() {
  14. // testWidgets('Counter increments smoke test', (WidgetTester tester) async {
  15. // // Build our app and trigger a frame.
  16. //
  17. // // Verify that our counter starts at 0.
  18. // // expect(find.text('0'), findsOneWidget);
  19. // // expect(find.text('1'), findsNothing);
  20. //
  21. // // Tap the '+' icon and trigger a frame.
  22. // await tester.tap(find.byIcon(Icons.add));
  23. // await tester.pump();
  24. //
  25. // // Verify that our counter has incremented.
  26. // expect(find.text('0'), findsNothing);
  27. // expect(find.text('1'), findsOneWidget);
  28. // });
  29. test("测试 value 递增", () {
  30. var ss = String.fromCharCodes(base64Decode('eyJhIjoxMSwiYXYiOiIxLjAuMCIsImMiOjMsImNpIjoxNTI1NTIxOTY4MDA1MTIsImRpIjoiYXdlcmRhczIyMjFmeWMiLCJwbiI6ImNvbS5zdGFyYnVkcy5hcHAiLCJzIjoiYWMwODYxMTlhMGZiNzIzMWZiM2ZkM2Q4ZDU4OTQwZDQiLCJzdCI6MSwidCI6IiIsInRzIjoxNjI5Mjc5MTAzNjQyfQ=='));
  31. // 验证 counter.value 的是是否为 1
  32. print(ss);
  33. });
  34. }