-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss_object_fit_test.dart
More file actions
27 lines (26 loc) · 1.01 KB
/
css_object_fit_test.dart
File metadata and controls
27 lines (26 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import 'package:spark_css/spark_css.dart';
import 'package:test/test.dart';
void main() {
group('CssObjectFit', () {
test('keywords output correct CSS', () {
expect(CssObjectFit.fill.toCss(), equals('fill'));
expect(CssObjectFit.contain.toCss(), equals('contain'));
expect(CssObjectFit.cover.toCss(), equals('cover'));
expect(CssObjectFit.none.toCss(), equals('none'));
expect(CssObjectFit.scaleDown.toCss(), equals('scale-down'));
});
test('variable outputs correct CSS', () {
expect(CssObjectFit.variable('of').toCss(), equals('var(--of)'));
});
test('raw outputs value as-is', () {
expect(CssObjectFit.raw('cover').toCss(), equals('cover'));
});
test('global outputs correct CSS', () {
expect(CssObjectFit.global(CssGlobal.inherit).toCss(), equals('inherit'));
});
test('Style.typed integration', () {
final style = Style.typed(objectFit: CssObjectFit.cover);
expect(style.toCss(), contains('object-fit: cover;'));
});
});
}