fix
This commit is contained in:
@@ -311,9 +311,7 @@ class _Tab extends StatelessWidget {
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: selected ? accent : const Color(0x247FB8D4),
|
||||
),
|
||||
bottom: BorderSide(color: selected ? accent : Colors.transparent),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
|
||||
@@ -81,4 +81,40 @@ void main() {
|
||||
|
||||
expect(requestedMode, MwAuthenticationMode.registration);
|
||||
});
|
||||
|
||||
testWidgets('inactive authentication tab has no divider', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: MoonWellTheme.create(MoonWellThemeVariant.forest),
|
||||
home: Scaffold(
|
||||
body: MwAuthenticationForm(
|
||||
usernameController: TextEditingController(),
|
||||
passwordController: TextEditingController(),
|
||||
onSubmit: () {},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final tabBorders = tester
|
||||
.widgetList<Container>(
|
||||
find.descendant(
|
||||
of: find.byType(MwAuthenticationForm),
|
||||
matching: find.byType(Container),
|
||||
),
|
||||
)
|
||||
.map((container) => container.decoration)
|
||||
.whereType<BoxDecoration>()
|
||||
.map((decoration) => decoration.border)
|
||||
.whereType<Border>()
|
||||
.where((border) => border.bottom.style != BorderStyle.none)
|
||||
.map((border) => border.bottom.color)
|
||||
.toList();
|
||||
|
||||
expect(tabBorders, hasLength(2));
|
||||
expect(
|
||||
tabBorders.where((color) => color == Colors.transparent),
|
||||
hasLength(1),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user