-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit tests added for android.dart. Fixed directory path for adaptive …
…icons.
- Loading branch information
1 parent
35d1843
commit 022c5e6
Showing
6 changed files
with
74 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: flutter_launcher_icons | ||
description: A package which simplifies the task of updating your Flutter app's launcher icon. Fully flexible, allowing you to choose what platform you wish to update the launcher icon for and if you want, the option to keep your old launcher icon in case you want to revert back sometime in the future. | ||
version: 0.5.1 | ||
version: 0.5.2 | ||
homepage: https://github.com/franzsilva/flutter_launcher_icons | ||
authors: | ||
- Franz Silva <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:test/test.dart'; | ||
import 'package:flutter_launcher_icons/android.dart' as Android; | ||
|
||
/** | ||
* Unit tests for android.dart | ||
*/ | ||
|
||
void main() { | ||
test('Adaptive icon mipmap path is correct', () { | ||
String path1 = "android/app/src/main/res/"; | ||
String path2 = "mipmap-anydpi-v26/"; | ||
expect(Android.isCorrectMipmapDirectoryForAdaptiveIcon(path1), false); | ||
expect(Android.isCorrectMipmapDirectoryForAdaptiveIcon(path2), false); | ||
expect(Android.isCorrectMipmapDirectoryForAdaptiveIcon(Android.android_adaptive_xml_folder), true); | ||
}); | ||
|
||
test('Correct number of adaptive foreground icons', () { | ||
expect(Android.adaptive_foreground_icons.length, 5); | ||
}); | ||
|
||
test('Correct number of android launcher icons', () { | ||
expect(Android.android_icons.length, 5); | ||
}); | ||
|
||
test('Config contains string for generating new launcher icons', () { | ||
Map flutter_icons_config = {"image_path": "assets/images/icon-710x599.png", | ||
"android": true, "ios": true}; | ||
expect(Android.isCustomAndroidFile(flutter_icons_config), false); | ||
|
||
Map flutter_icons_new_icon_config = {"image_path": "assets/images/icon-710x599.png", | ||
"android": "New Icon", "ios": true}; | ||
expect(Android.isCustomAndroidFile(flutter_icons_new_icon_config), true); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters