diff --git a/packages/device_info_plus/CHANGELOG.md b/packages/device_info_plus/CHANGELOG.md index 3ce01135c..55c40a134 100644 --- a/packages/device_info_plus/CHANGELOG.md +++ b/packages/device_info_plus/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Add 2 integration test cases. + ## 1.4.0 * Add `freeDiskSize` and `totalDiskSize` using the Tizen Storage API. diff --git a/packages/device_info_plus/example/integration_test/device_info_plus_test.dart b/packages/device_info_plus/example/integration_test/device_info_plus_test.dart index e2afa8b80..fef562a7e 100644 --- a/packages/device_info_plus/example/integration_test/device_info_plus_test.dart +++ b/packages/device_info_plus/example/integration_test/device_info_plus_test.dart @@ -55,4 +55,32 @@ void main() { lessThanOrEqualTo(tizenInfo.physicalRamSize), ); }, skip: !Platform.isLinux); + + testWidgets('tizenInfo is consistent across repeated calls', ( + WidgetTester tester, + ) async { + // Repeated calls on the same instance return the cached instance. + final plugin1 = DeviceInfoPluginTizen(); + final first = await plugin1.tizenInfo; + final second = await plugin1.tizenInfo; + expect(second, same(first)); + + // A new instance triggers a fresh native call that must yield the same data. + final plugin2 = DeviceInfoPluginTizen(); + final third = await plugin2.tizenInfo; + expect(third.modelName, first.modelName); + }, skip: !Platform.isLinux); + + testWidgets('TizenDeviceInfo.fromMap round-trips through data', ( + WidgetTester tester, + ) async { + final data = tizenInfo.data; + expect(data, isNotEmpty); + + final rebuilt = TizenDeviceInfo.fromMap(data); + expect(rebuilt.modelName, tizenInfo.modelName); + expect(rebuilt.platformVersion, tizenInfo.platformVersion); + expect(rebuilt.screenWidth, tizenInfo.screenWidth); + expect(rebuilt.totalDiskSize, tizenInfo.totalDiskSize); + }, skip: !Platform.isLinux); }