flutter/packages/unit/test/rendering/flex_test.dart
Adam Barth 2473346fce RenderFlex should handle overconstrainted constraints
Rather than reading out the maxWidth, we should call constrainWidth to factor
in the minWidth, which might be bigger.
2015-09-03 10:35:40 -07:00

17 lines
570 B
Dart

import 'package:sky/rendering.dart';
import 'package:test/test.dart';
import 'rendering_tester.dart';
void main() {
test('Overconstrained flex', () {
RenderDecoratedBox box = new RenderDecoratedBox(decoration: new BoxDecoration());
RenderFlex flex = new RenderFlex(children: [ box ]);
layout(flex, constraints: const BoxConstraints(
minWidth: 200.0, maxWidth: 100.0, minHeight: 200.0, maxHeight: 100.0));
expect(flex.size.width, equals(200.0), reason: "flex width");
expect(flex.size.height, equals(200.0), reason: "flex height");
});
}