fix: issue-942, issue-967, fixed images positioning for blog posts

This commit is contained in:
misha
2026-08-28 10:05:40 +03:00
parent 8f933118a3
commit 10af279d87
22 changed files with 484 additions and 84 deletions

View File

@@ -56,6 +56,33 @@ void main() {
});
});
group('Author', () {
test('fromJson читает author_roles и определяет админа', () {
final author = Author.fromJson({
'author_slug': 'admin-user',
'author_name': 'Admin',
'author_profile_icon': 'icon.jpg',
'author_is_me': false,
'author_roles': ['admin', 'consultant'],
});
expect(author.authorRoles, ['admin', 'consultant']);
expect(author.isAdmin, isTrue);
});
test('fromJson без author_roles не считает автора админом', () {
final author = Author.fromJson({
'author_slug': 'regular-user',
'author_name': 'User',
'author_profile_icon': 'icon.jpg',
'author_is_me': false,
});
expect(author.authorRoles, isEmpty);
expect(author.isAdmin, isFalse);
});
});
group('DietState', () {
test('toString возвращает правильные значения', () {
expect(DietState.active.toString(), 'active');