mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-05 20:35:10 -05:00
Restructuring the Repo to make it clear the difference between classic autogpt and the autogpt platform: * Move the "classic" projects `autogpt`, `forge`, `frontend`, and `benchmark` into a `classic` folder * Also rename `autogpt` to `original_autogpt` for absolute clarity * Rename `rnd/` to `autogpt_platform/` * `rnd/autogpt_builder` -> `autogpt_platform/frontend` * `rnd/autogpt_server` -> `autogpt_platform/backend` * Adjust any paths accordingly
25 lines
754 B
Dart
25 lines
754 B
Dart
import 'package:auto_gpt_flutter_client/views/task/new_task_button.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
testWidgets('NewTaskButton triggers callback on press',
|
|
(WidgetTester tester) async {
|
|
bool wasPressed = false;
|
|
|
|
// Build our widget.
|
|
await tester.pumpWidget(MaterialApp(
|
|
home: Scaffold(
|
|
body: NewTaskButton(onPressed: () => wasPressed = true),
|
|
),
|
|
));
|
|
|
|
// Verify if the button with the text 'New Task' is displayed.
|
|
expect(find.text('New Task'), findsOneWidget);
|
|
|
|
// Tap the button and verify if the onPressed callback is triggered.
|
|
await tester.tap(find.byType(ElevatedButton));
|
|
expect(wasPressed, true);
|
|
});
|
|
}
|