Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
Feature/integration tests (#90)
Browse files Browse the repository at this point in the history
* Adding PageScaffold and DoubleBackToClose

* Adding clients over time chart

* Clients/domains pageview shows error

* Adding integration test

* Updating dependencies
  • Loading branch information
sterrenb committed May 23, 2020
1 parent b5e0dfe commit e95a013
Show file tree
Hide file tree
Showing 90 changed files with 3,860 additions and 511 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ app.*.map.json
android/app/keystore.jks
android/app/upload_certificate.pem
/ios/Runner/Assets.xcassets/AppIcon.appiconset/
android/key.properties
android/key.properties
/ozzie/
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ FlutterHole is a free third party Android application for interacting with your
- **Quick enable/disable:** Toggle your Pi-hole from your home screen with a single tap.
- **Multiple configurations:** Easily switch between every Pi-hole that you have access to.
- **Summary overview:** View top clients and the top used domains.
- **Query log:** Inspect & search your Pi-hole queries.

## Roadmap/missing features ##
- **Manage your blacklist & whitelist:** Blocking issues. See [issue #76](https://github.com/sterrenburg/flutterhole/issues/76) for progress.
- **Query log:** Coming soon for V5!
- **Proxy support:** Coming soon for V5!

## Development ##
Expand Down Expand Up @@ -67,12 +67,30 @@ flutter pub get
flutter pub run flutter_launcher_icons:main
```

#### Generate code
#### Generate code ####

To generate `freezed` classes `injectable` injections etc.:

```shell script
flutter pub run build_runner build --delete-conflicting-outputs
```

Or, build continuously:

```shell script
flutter pub run build_runner watch --delete-conflicting-outputs
```

You can now build and run the app on either an emulator or a physical device using `flutter run`.

### Testing ###

To run the default integration test:

```shell script
flutter drive --target=test_driver/app.dart
```

## API ##
This application interacts with the [Pi-hole PHP API](https://discourse.pi-hole.net/t/pi-hole-api/1863).

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'dart:convert';
import 'dart:io';

const fixturePath = 'test/fixtures/';
const kFixturePath = 'test/fixtures/';

/// Hack fix for `flutter test` outside IDE
/// https://stackoverflow.com/questions/45780255/flutter-how-to-load-file-for-testing
String _loadFileAsString(String name) {
String _loadFileAsString(String name, String fixturePath) {
final String filePath = '$fixturePath$name';

String fileString;
Expand All @@ -21,8 +21,8 @@ String _loadFileAsString(String name) {
/// Returns the json representation of the fixture file [name].
///
/// Typically returns a `Map<String, dynamic>` or `List<dynamic>`.
dynamic jsonFixture(String name) {
final string = _loadFileAsString(name);
dynamic jsonFixture(String name, {fixturePath = kFixturePath}) {
final string = _loadFileAsString(name, fixturePath);

try {
return jsonDecode(string);
Expand Down
12 changes: 7 additions & 5 deletions lib/dependency_injection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Future<void> configure(String environment) async {
}

@registerModule
abstract class RegisterModule {
abstract class RegisterProdModule {
@prod
@injectable
Dio get dio => Dio();
Expand All @@ -32,12 +32,14 @@ abstract class RegisterModule {
@singleton
Sailor get sailor => Sailor(
options: SailorOptions(
isLoggingEnabled: true,
isLoggingEnabled: false,
));

@prod
@singleton
Alice get alice => Alice(
showNotification: false,
darkTheme: true,
);
showNotification: false,
darkTheme: true,
);
}

0 comments on commit e95a013

Please sign in to comment.