2024-01-27 10:57:09 +08:00
|
|
|
import 'package:appflowy/plugins/database/widgets/cell_editor/extension.dart';
|
2024-01-05 17:30:54 +08:00
|
|
|
import 'package:appflowy/plugins/database/widgets/row/row_property.dart';
|
2023-12-31 07:29:40 +08:00
|
|
|
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
|
2024-01-24 23:59:45 +08:00
|
|
|
import 'package:flutter/widgets.dart';
|
2023-11-30 19:54:10 +03:30
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:integration_test/integration_test.dart';
|
|
|
|
import 'package:appflowy_board/appflowy_board.dart';
|
|
|
|
|
|
|
|
import '../util/util.dart';
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
|
|
|
group('board group test', () {
|
|
|
|
testWidgets('move row to another group', (tester) async {
|
|
|
|
const card1Name = 'Card 1';
|
|
|
|
await tester.initializeAppFlowy();
|
|
|
|
await tester.tapGoButton();
|
|
|
|
|
2023-12-27 11:42:39 +08:00
|
|
|
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);
|
2023-11-30 19:54:10 +03:30
|
|
|
final card1 = find.ancestor(
|
2024-01-24 23:59:45 +08:00
|
|
|
of: find.text(card1Name),
|
2023-11-30 19:54:10 +03:30
|
|
|
matching: find.byType(AppFlowyGroupCard),
|
|
|
|
);
|
2024-01-24 23:59:45 +08:00
|
|
|
final doingGroup = find.text('Doing');
|
2023-11-30 19:54:10 +03:30
|
|
|
final doingGroupCenter = tester.getCenter(doingGroup);
|
|
|
|
final card1Center = tester.getCenter(card1);
|
|
|
|
|
|
|
|
await tester.timedDrag(
|
2023-12-08 20:01:54 +07:00
|
|
|
card1,
|
2023-11-30 19:54:10 +03:30
|
|
|
doingGroupCenter.translate(-card1Center.dx, -card1Center.dy),
|
|
|
|
const Duration(seconds: 1),
|
|
|
|
);
|
|
|
|
await tester.pumpAndSettle();
|
|
|
|
await tester.tap(card1);
|
|
|
|
await tester.pumpAndSettle();
|
|
|
|
|
|
|
|
final card1StatusFinder = find.descendant(
|
2023-12-08 20:01:54 +07:00
|
|
|
of: find.byType(RowPropertyList),
|
2023-11-30 19:54:10 +03:30
|
|
|
matching: find.descendant(
|
2023-12-08 20:01:54 +07:00
|
|
|
of: find.byType(SelectOptionTag),
|
2024-01-24 23:59:45 +08:00
|
|
|
matching: find.byType(Text),
|
2023-11-30 19:54:10 +03:30
|
|
|
),
|
|
|
|
);
|
|
|
|
expect(card1StatusFinder, findsNWidgets(1));
|
2024-01-24 23:59:45 +08:00
|
|
|
final card1StatusText = tester.widget<Text>(card1StatusFinder).data;
|
2023-11-30 19:54:10 +03:30
|
|
|
expect(card1StatusText, 'Doing');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|