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`
This commit is contained in:
22
examples/api/test/widgets/framework/build_owner.0_test.dart
Normal file
22
examples/api/test/widgets/framework/build_owner.0_test.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
// 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),
|
||||
);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user