mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2026-01-09 13:53:38 +00:00
fix(flutter_desktop): row detail checklist cell "create new" text field doesn't clear after clicking on create button (#7055)
* fix: clear text controller when clicking on add button no matter what * test: add integration test
This commit is contained in:
parent
83e50d376e
commit
956d2dfd07
@ -394,11 +394,16 @@ void main() {
|
||||
isChecked: false,
|
||||
);
|
||||
tester.assertPhantomChecklistItemAtIndex(index: 1);
|
||||
tester.assertPhantomChecklistItemContent("");
|
||||
|
||||
await tester.enterText(find.byType(PhantomChecklistItem), 'task 2');
|
||||
await tester.pumpAndSettle();
|
||||
await tester.simulateKeyEvent(LogicalKeyboardKey.enter);
|
||||
await tester.pumpAndSettle(const Duration(milliseconds: 500));
|
||||
await tester.hoverOnWidget(
|
||||
find.byType(ChecklistRowDetailCell),
|
||||
onHover: () async {
|
||||
await tester.tapButton(find.byType(ChecklistItemControl));
|
||||
},
|
||||
);
|
||||
|
||||
tester.assertChecklistTaskInEditor(
|
||||
index: 1,
|
||||
@ -406,6 +411,7 @@ void main() {
|
||||
isChecked: false,
|
||||
);
|
||||
tester.assertPhantomChecklistItemAtIndex(index: 2);
|
||||
tester.assertPhantomChecklistItemContent("");
|
||||
|
||||
await tester.simulateKeyEvent(LogicalKeyboardKey.escape);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
@ -567,6 +567,12 @@ extension AppFlowyDatabaseTest on WidgetTester {
|
||||
expect(phantom is PhantomChecklistItem, true);
|
||||
}
|
||||
|
||||
void assertPhantomChecklistItemContent(String content) {
|
||||
final phantom = find.byType(PhantomChecklistItem);
|
||||
final text = find.text(content);
|
||||
expect(find.descendant(of: phantom, matching: text), findsOneWidget);
|
||||
}
|
||||
|
||||
Future<void> openFirstRowDetailPage() async {
|
||||
await hoverOnFirstRowOfGrid();
|
||||
|
||||
|
||||
@ -89,7 +89,6 @@ class _ChecklistRowDetailCellState extends State<ChecklistRowDetailCell> {
|
||||
onTap: () {
|
||||
final bloc = context.read<ChecklistCellBloc>();
|
||||
if (bloc.state.phantomIndex == null) {
|
||||
phantomTextController.clear();
|
||||
bloc.add(
|
||||
ChecklistCellEvent.updatePhantomIndex(
|
||||
bloc.state.showIncompleteOnly
|
||||
@ -107,6 +106,7 @@ class _ChecklistRowDetailCellState extends State<ChecklistRowDetailCell> {
|
||||
),
|
||||
);
|
||||
}
|
||||
phantomTextController.clear();
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user