import 'package:sharedinbox/core/utils/html_utils.dart';
import 'package:test/test.dart';
void main() {
group('htmlToPlain', () {
test('returns plain text unchanged', () {
expect(htmlToPlain('Hello world'), 'Hello world');
});
test('strips simple tags', () {
expect(htmlToPlain('bold text'), 'bold text');
});
test('converts
to newline', () {
expect(htmlToPlain('line1
line2'), 'line1\nline2');
});
test('converts self-closing
to newline', () {
expect(htmlToPlain('line1
line2'), 'line1\nline2');
});
test('converts
to newline', () { expect(htmlToPlain('
paragraph
'), 'paragraph'); }); test('decodes &', () { expect(htmlToPlain('a & b'), 'a & b'); }); test('decodes < and >', () { expect(htmlToPlain('<tag>'), 'text
Hello Alice,
' 'Please find the invoice attached.
' 'Best regards,
Bob