Tests
This commit is contained in:
parent
9ea3ab5e84
commit
6750c6846c
|
|
@ -140,6 +140,21 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||||
final store = StoreProvider.of<AppState>(context);
|
final store = StoreProvider.of<AppState>(context);
|
||||||
final state = store.state;
|
final state = store.state;
|
||||||
final company = state.company;
|
final company = state.company;
|
||||||
|
Widget leading = SizedBox();
|
||||||
|
|
||||||
|
if (isMobile(context) || state.prefState.isMenuFloated) {
|
||||||
|
leading = Builder(
|
||||||
|
builder: (context) => InkWell(
|
||||||
|
child: IconButton(
|
||||||
|
tooltip: localization.menuSidebar,
|
||||||
|
icon: Icon(Icons.menu),
|
||||||
|
onPressed: () {
|
||||||
|
Scaffold.of(context).openDrawer();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
final mainScaffold = Scaffold(
|
final mainScaffold = Scaffold(
|
||||||
drawer: isMobile(context) || state.prefState.isMenuFloated
|
drawer: isMobile(context) || state.prefState.isMenuFloated
|
||||||
|
|
@ -150,9 +165,8 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||||
: null,
|
: null,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
leading: isMobile(context) || state.prefState.isMenuFloated
|
automaticallyImplyLeading: false,
|
||||||
? null
|
leading: leading,
|
||||||
: SizedBox(),
|
|
||||||
title: ListFilter(
|
title: ListFilter(
|
||||||
key: ValueKey('__cleared_at_${state.uiState.filterClearedAt}__'),
|
key: ValueKey('__cleared_at_${state.uiState.filterClearedAt}__'),
|
||||||
entityType: EntityType.dashboard,
|
entityType: EntityType.dashboard,
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,22 @@ class ReportsScreen extends StatelessWidget {
|
||||||
final reportsState = viewModel.reportState;
|
final reportsState = viewModel.reportState;
|
||||||
final reportResult = viewModel.reportResult;
|
final reportResult = viewModel.reportResult;
|
||||||
|
|
||||||
|
Widget leading = SizedBox();
|
||||||
|
|
||||||
|
if (isMobile(context) || state.prefState.isMenuFloated) {
|
||||||
|
leading = Builder(
|
||||||
|
builder: (context) => InkWell(
|
||||||
|
child: IconButton(
|
||||||
|
tooltip: localization.menuSidebar,
|
||||||
|
icon: Icon(Icons.menu),
|
||||||
|
onPressed: () {
|
||||||
|
Scaffold.of(context).openDrawer();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
final hasCustomDate = reportsState.filters.keys.where((column) {
|
final hasCustomDate = reportsState.filters.keys.where((column) {
|
||||||
final filter = reportsState.filters[column];
|
final filter = reportsState.filters[column];
|
||||||
return (getReportColumnType(column, context) ==
|
return (getReportColumnType(column, context) ==
|
||||||
|
|
@ -195,8 +211,8 @@ class ReportsScreen extends StatelessWidget {
|
||||||
: null,
|
: null,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
automaticallyImplyLeading:
|
automaticallyImplyLeading: false,
|
||||||
isMobile(context) || state.prefState.isMenuFloated,
|
leading: leading,
|
||||||
title: Row(
|
title: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Logout from a logged in user', () async {
|
test('Logout from a logged in user', () async {
|
||||||
await logout(driver, localization, fromDashboard: true);
|
await logout(driver, localization);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import 'package:invoiceninja_flutter/constants.dart';
|
||||||
import 'localizations.dart';
|
import 'localizations.dart';
|
||||||
|
|
||||||
class Keys {
|
class Keys {
|
||||||
static const String openAppDrawer = 'Open navigation menu';
|
|
||||||
static const String clientPickerEmptyKey = '__client___';
|
static const String clientPickerEmptyKey = '__client___';
|
||||||
static const String invoiceLineItemBaseKey = '__line_item';
|
static const String invoiceLineItemBaseKey = '__line_item';
|
||||||
}
|
}
|
||||||
|
|
@ -71,12 +70,9 @@ Future<void> login(FlutterDriver driver,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> logout(FlutterDriver driver, TestLocalization localization,
|
Future<void> logout(FlutterDriver driver, TestLocalization localization) async {
|
||||||
{bool fromDashboard = false}) async {
|
|
||||||
if (await isMobile(driver)) {
|
if (await isMobile(driver)) {
|
||||||
await driver.tap(fromDashboard
|
await driver.tap(find.byTooltip(localization.menuSidebar));
|
||||||
? find.byTooltip(Keys.openAppDrawer)
|
|
||||||
: find.byTooltip(localization.menuSidebar));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//await driver.scrollUntilVisible(find.byType('Drawer'), find.text(localization.settings));
|
//await driver.scrollUntilVisible(find.byType('Drawer'), find.text(localization.settings));
|
||||||
|
|
@ -96,9 +92,10 @@ Future<void> logout(FlutterDriver driver, TestLocalization localization,
|
||||||
await driver.waitFor(find.text(localization.selfhosted.toUpperCase()));
|
await driver.waitFor(find.text(localization.selfhosted.toUpperCase()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> viewSection({FlutterDriver driver, String name}) async {
|
Future<void> viewSection(
|
||||||
|
{FlutterDriver driver, String name, TestLocalization localization}) async {
|
||||||
if (await isMobile(driver)) {
|
if (await isMobile(driver)) {
|
||||||
await driver.tap(find.byTooltip(Keys.openAppDrawer));
|
await driver.tap(find.byTooltip('Menu Sidebar'));
|
||||||
}
|
}
|
||||||
|
|
||||||
await driver.tap(find.byValueKey('menu_' + name));
|
await driver.tap(find.byValueKey('menu_' + name));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue