Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test InputDecoration API examples #148560

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

NobodyForNothing
Copy link
Contributor

Add tests for InputDecoration API example as part of #130459. Updates examples that use the deprecated MaterialState to use WidgetState. Tests files: input_decoration.0.dart, input_decoration.1.dart, input_decoration.2.dart, input_decoration.3.dart, input_decoration.widget_state.0.dart, input_decoration.widget_state.1.dart, input_decoration.prefix_icon_constraints.0.dart, input_decoration.suffix_icon_constraints.0.dart, and input_decoration.label.0.dart

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos labels May 17, 2024
@github-actions github-actions bot added the f: material design flutter/packages/flutter/material repository. label May 18, 2024
@Piinks
Copy link
Contributor

Piinks commented May 22, 2024

@NobodyForNothing thanks for contributing! It looks like there are some failing checks, can you take a look?

Copy link
Member

@TahaTesser TahaTesser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tests collection!

import 'package:flutter_test/flutter_test.dart';

void main() {
testWidgets('Shows all decorations', (WidgetTester tester) async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
testWidgets('Shows all decorations', (WidgetTester tester) async {
testWidgets('TextField is decorated', (WidgetTester tester) async {

import 'package:flutter_test/flutter_test.dart';

void main() {
testWidgets('Shows all decorations', (WidgetTester tester) async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
testWidgets('Shows all decorations', (WidgetTester tester) async {
testWidgets('TextField is decorated', (WidgetTester tester) async {

import 'package:flutter_test/flutter_test.dart';

void main() {
testWidgets('Shows all decorations', (WidgetTester tester) async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
testWidgets('Shows all decorations', (WidgetTester tester) async {
testWidgets('TextFormField is decorated', (WidgetTester tester) async {

import 'package:flutter_test/flutter_test.dart';

void main() {
testWidgets('Shows the whole app', (WidgetTester tester) async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
testWidgets('Shows the whole app', (WidgetTester tester) async {
testWidgets('Shows the whole app', (WidgetTester tester) async {

This title can be improved,

import 'package:flutter_test/flutter_test.dart';

void main() {
testWidgets('Shows all decorations', (WidgetTester tester) async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
testWidgets('Shows all decorations', (WidgetTester tester) async {
testWidgets('Shows all decorations', (WidgetTester tester) async {

Same here

import 'package:flutter_test/flutter_test.dart';

void main() {
testWidgets('Shows all decorations', (WidgetTester tester) async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
testWidgets('Shows all decorations', (WidgetTester tester) async {
testWidgets('Shows all decorations', (WidgetTester tester) async {

Same here

greaterThan(tester.getSize(smallerIcon).longestSide));
});

testWidgets('Is suffix icon', (WidgetTester tester) async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
testWidgets('Is suffix icon', (WidgetTester tester) async {
testWidgets('Is suffix icon', (WidgetTester tester) async {

Not sure what this means.

import 'package:flutter_test/flutter_test.dart';

void main() {
testWidgets('Shows all decorations', (WidgetTester tester) async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
testWidgets('Shows all decorations', (WidgetTester tester) async {
testWidgets('Shows all decorations', (WidgetTester tester) async {

Same here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants