forked from fluttercommunity/flutter_launcher_icons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(web): added tests for web icon templates
- Loading branch information
1 parent
c2aaaa8
commit bae9be2
Showing
1 changed file
with
30 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'package:flutter_launcher_icons/web/web_template.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
group('WebTemplate', () { | ||
late WebIconTemplate icTemplate; | ||
late WebIconTemplate icMaskableTemplate; | ||
|
||
setUp(() { | ||
icTemplate = const WebIconTemplate(size: 512); | ||
icMaskableTemplate = const WebIconTemplate(size: 512, maskable: true); | ||
}); | ||
|
||
test('.iconFile should return valid file name', () async { | ||
expect(icTemplate.iconFile, equals('Icon-512.png')); | ||
expect(icMaskableTemplate.iconFile, equals('Icon-maskable-512.png')); | ||
}); | ||
|
||
test('.iconManifest should return valid manifest config', () { | ||
expect( | ||
icTemplate.iconManifest, | ||
equals({'src': 'icons/Icon-512.png', 'sizes': '512x512', 'type': 'image/png'}), | ||
); | ||
expect( | ||
icMaskableTemplate.iconManifest, | ||
equals({'src': 'icons/Icon-maskable-512.png', 'sizes': '512x512', 'type': 'image/png', 'purpose': 'maskable'}), | ||
); | ||
}); | ||
}); | ||
} |