Skip to content

Commit

Permalink
added keys to widgets for integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Uuttssaavv committed Oct 22, 2022
1 parent c87b8bd commit faef643
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ class AuthenticationScreen extends StatefulWidget {
}

class _AuthenticationScreenState extends State<AuthenticationScreen> {
final TextEditingController _emailController =
TextEditingController(text: 'kminchelle');
final TextEditingController _passwordController =
TextEditingController(text: '0lelplR');
final TextEditingController _emailController = TextEditingController();
final TextEditingController _passwordController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
Expand All @@ -33,11 +31,13 @@ class _AuthenticationScreenState extends State<AuthenticationScreen> {
AuthField(
hintText: 'Username',
controller: _emailController,
key: const Key('username-field'),
),
AuthField(
hintText: 'Password',
controller: _passwordController,
obscureText: true,
key: const Key('password-field'),
),
const SizedBox(height: 16.0),
BlocConsumer<AuthenticationBloc, AuthenticationState>(
Expand Down Expand Up @@ -72,6 +72,7 @@ class _AuthenticationScreenState extends State<AuthenticationScreen> {
height: 54.0,
width: 180.0,
child: ElevatedButton(
key: const Key('login-button'),
style: const ButtonStyle(),
onPressed: () {
context.read<AuthenticationBloc>().add(
Expand Down
1 change: 1 addition & 0 deletions lib/features/auth/presentation/shared/textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class AuthField extends StatelessWidget {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 8.0),
child: TextField(
key: key,
controller: controller,
obscureText: obscureText,
decoration: InputDecoration(
Expand Down

0 comments on commit faef643

Please sign in to comment.