Skip to content

Commit d5634f2

Browse files
committed
test: add test for syncing color with dart_bbcode_web_colors
1 parent ce3b47f commit d5634f2

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import 'package:collection/collection.dart';
2+
import 'package:dart_bbcode_web_colors/dart_bbcode_web_colors.dart';
3+
import 'package:flutter_bbcode_editor/flutter_bbcode_editor.dart';
4+
import 'package:flutter_test/flutter_test.dart';
5+
6+
void main() {
7+
test('values synced with dart_bbcode_web_colors', () {
8+
// All colors in `BBCodeEditorColor` shall have the same value with the one in `WebColors`.
9+
for (final color in BBCodeEditorColor.values) {
10+
final target = WebColors.values.firstWhereOrNull(
11+
(e) => e.colorValue == color.color.toARGB32() && e.name.toLowerCase() == color.namedColor.toLowerCase(),
12+
);
13+
expect(target != null, true, reason: 'BBCodeEditorColor "$color" not synced');
14+
}
15+
});
16+
}

0 commit comments

Comments
 (0)