Skip to content

Commit

Permalink
fix: remove heading node validation (AppFlowy-IO#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 authored May 20, 2024
1 parent 796d124 commit cfd41d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ class HeadingBlockComponentBuilder extends BlockComponentBuilder {
}

@override
bool validate(Node node) =>
node.delta != null &&
node.children.isEmpty &&
node.attributes[HeadingBlockKeys.level] is int;
bool validate(Node node) => true;
}

class HeadingBlockComponentWidget extends BlockComponentStatefulWidget {
Expand Down
6 changes: 1 addition & 5 deletions test/customer/custom_error_block_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ void main() async {
'text': 'line 1',
},
),
Node(
type: 'heading',
attributes: {},
),
],
);
final widget = ErrorEditor(
Expand All @@ -30,7 +26,7 @@ void main() async {
await tester.pumpWidget(widget);
await tester.pumpAndSettle();

expect(find.byType(ErrorBlockComponentWidget), findsNWidgets(2));
expect(find.byType(ErrorBlockComponentWidget), findsNWidgets(1));
});
}

Expand Down

0 comments on commit cfd41d4

Please sign in to comment.