Skip to content

Commit

Permalink
test(web): added tests for web icon templates
Browse files Browse the repository at this point in the history
  • Loading branch information
RatakondalaArun committed Jul 10, 2022
1 parent c2aaaa8 commit bae9be2
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/web/web_template_test.dart
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'}),
);
});
});
}

0 comments on commit bae9be2

Please sign in to comment.