Files
GitJournal/test/strip_markdown_formatting_test.dart
Vishesh Handa 88552fe8e9 Revert "Workaround intl bug by harding 'en' locale"
This reverts commit 303192d9d575b26a77a00f7a62212f310ec1e329.
This reverts commit cd9d128b47ed523036f7ae1232ec7adcf04ed8a9.

GitJournal is used by non-English speakers (a lot in China and Russia)
and while we don't support those languages completely, we do support
them a little bit. I don't want to loose this functionality. It would be
better for us to fix the bug in intl.
2020-06-10 09:31:08 +02:00

58 lines
1.1 KiB
Dart

import 'package:gitjournal/utils/markdown.dart';
import 'package:test/test.dart';
void main() {
group('Markdown Remove Formatting', () {
test('Test Headers', () {
var input = '# Hello\nHow are you?';
expect(stripMarkdownFormatting(input), 'Hello How are you? ');
});
test('Test Header2', () {
var input = """Test Header
----------
Hello
""";
expect(stripMarkdownFormatting(input), 'Test Header Hello ');
});
test('Itemized LIsts', () {
var input = """Itemized lists
look like:
* this one
* that one
""";
expect(stripMarkdownFormatting(input),
'Itemized lists look like: • this one • that one ');
});
test('Checklist', () {
var input = """Itemized lists
- [ ] this one
- [x] that one
- [X] last
""";
expect(stripMarkdownFormatting(input),
'Itemized lists ☐ this one ☑ that one ☑ last ');
});
test('List', () {
var input = """Itemized lists
* this one
* that one
* four
""";
expect(stripMarkdownFormatting(input),
'Itemized lists • this one • that one • four ');
});
});
}