From 83d2d91f07a6e0b171ff87c56bd058bfc1e38192 Mon Sep 17 00:00:00 2001 From: Frank Merkel <138444693+frankmer@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:48:36 +0100 Subject: [PATCH] Refactor application customization tests to update property names for appbarIcon and splashScreenImage --- lib/model/extensions/enums/image_file_type_extension.dart | 2 +- .../customization/application_customization_test.dart | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/model/extensions/enums/image_file_type_extension.dart b/lib/model/extensions/enums/image_file_type_extension.dart index 62fb782b..81266980 100644 --- a/lib/model/extensions/enums/image_file_type_extension.dart +++ b/lib/model/extensions/enums/image_file_type_extension.dart @@ -25,7 +25,7 @@ import 'package:image_picker/image_picker.dart'; import '../../enums/image_file_type.dart'; -extension ImageFileTypeX on ImageFormat { +extension ImageFormatX on ImageFormat { static ImageFormat fromExtensionString(String ex) => switch (ex) { 'svg' => ImageFormat.svg, 'svgz' => ImageFormat.svgz, diff --git a/test/unit_test/utils/customization/application_customization_test.dart b/test/unit_test/utils/customization/application_customization_test.dart index a7112a7a..edf34c27 100644 --- a/test/unit_test/utils/customization/application_customization_test.dart +++ b/test/unit_test/utils/customization/application_customization_test.dart @@ -77,8 +77,8 @@ void _testAppCustomizer() { // Assert expect(json['appName'], equals('test')); expect(json['websiteLink'], equals('https://test')); - expect(json['appbarIcon'], equals({'fileType': 'png', 'imageData': base64Encode(defaultIconUint8List), 'fileName': 'appbarIcon'})); - expect(json['splashScreenImage'], equals({'fileType': 'png', 'imageData': base64Encode(defaultImageUint8List), 'fileName': 'splashScreenImage'})); + expect(json['appbarIcon'], equals({'imageFormat': 'png', 'imageData': base64Encode(defaultIconUint8List), 'fileName': 'appbarIcon'})); + expect(json['splashScreenImage'], equals({'imageFormat': 'png', 'imageData': base64Encode(defaultImageUint8List), 'fileName': 'splashScreenImage'})); expect(json['lightTheme'], equals(ApplicationCustomization.defaultCustomization.lightTheme.toJson())); expect(json['darkTheme'], equals(ApplicationCustomization.defaultCustomization.darkTheme.toJson())); expect(json['disabledFeatures'], equals({AppFeature.patchNotes.name})); @@ -109,8 +109,8 @@ void _testAppCustomizer() { final newCustomization = ApplicationCustomization.fromJson({ 'appName': 'test2', 'websiteLink': 'https://test2', - 'appbarIcon': {'fileType': 'png', 'imageData': base64Encode(defaultIconUint8List), 'fileName': 'appbarIcon'}, - 'splashScreenImage': {'fileType': 'png', 'imageData': base64Encode(defaultImageUint8List), 'fileName': 'splashScreenImage'}, + 'appbarIcon': {'imageFormat': 'png', 'imageData': base64Encode(defaultIconUint8List), 'fileName': 'appbarIcon'}, + 'splashScreenImage': {'imageFormat': 'png', 'imageData': base64Encode(defaultImageUint8List), 'fileName': 'splashScreenImage'}, 'lightTheme': ApplicationCustomization.defaultCustomization.lightTheme.toJson(), 'darkTheme': ApplicationCustomization.defaultCustomization.darkTheme.toJson(), 'disabledFeatures': [],