flutter/examples/api/test/widgets/framework/build_owner.0_test.dart
Valentin Vignal 086c07cc05
Add test for build_owner.0.dart (#157499)
Contributes to https://github.com/flutter/flutter/issues/130459

It adds a test for
- `examples/api/lib/widgets/framework/build_owner.0.dart`
2024-10-25 07:13:22 +00:00

23 lines
749 B
Dart

// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/widgets/framework/build_owner.0.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('BuildOwnerExample displays the measured size', (WidgetTester tester) async {
await tester.pumpWidget(const example.BuildOwnerExample());
expect(find.text('Size(640.0, 480.0)'), findsOne);
});
test('The size of the widget is measured', () {
expect(
example.measureWidget(const SizedBox(width: 234, height: 567)),
const Size(234, 567),
);
});
}