import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { group('customer html document test', () { test('paste text from ChatGPT', () { const html = '''

Key Pain Points & Challenges

  1. Accuracy, Hallucinations & Omissions

'''; final document = htmlToDocument(html); final children = document.root.children; expect(children.length, 2); // heading 2 - Key Pain Points & Challenges expect(children[0].type, HeadingBlockKeys.type); expect(children[0].delta!.toPlainText(), 'Key Pain Points & Challenges'); // numbered list - Accuracy, Hallucinations & Omissions expect(children[1].type, NumberedListBlockKeys.type); expect( children[1].delta!.toPlainText(), 'Accuracy, Hallucinations & Omissions', ); // its children - 3 bulleted list items final children1 = children[1].children; expect(children1.length, 3); expect( children1.every((child) => child.type == BulletedListBlockKeys.type), isTrue, ); }); test('paste text with an inline HTML comment does not leak comment text', () { // Some sites (e.g. Google Search AI Overview) inject an HTML comment // into copied content as an internal marker. It must not surface as // visible text, regardless of what the comment contains. const html = '''

First answer

Second answer

'''; final document = htmlToDocument(html); final children = document.root.children; expect(children[0].delta!.toPlainText(), 'First answer'); expect(children[1].delta!.toPlainText(), 'Second answer'); }); }); }