forked from eatvio/eatvio_app
fix: issue-942, issue-967, fixed images positioning for blog posts
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user