From 253a75129aa8351f63e9a4d580bfcea67b6c6c2e Mon Sep 17 00:00:00 2001
From: Oliver Walters <oliver.henry.walters@gmail.com>
Date: Sat, 21 May 2022 20:41:03 +1000
Subject: [PATCH] Extra tests

---
 test/preferences_test.dart                     | 9 +++++++++
 test/{api_test.dart => user_profile_test.dart} | 2 ++
 2 files changed, 11 insertions(+)
 rename test/{api_test.dart => user_profile_test.dart} (96%)

diff --git a/test/preferences_test.dart b/test/preferences_test.dart
index cca80185..b402b7a9 100644
--- a/test/preferences_test.dart
+++ b/test/preferences_test.dart
@@ -16,6 +16,15 @@ void main() {
       // Boolean values
       expect(await InvenTreeSettingsManager().getBool("test", false), equals(false));
       expect(await InvenTreeSettingsManager().getBool("test", true), equals(true));
+
+      // String values
+      expect(await InvenTreeSettingsManager().getValue("test", "x"), equals("x"));
+    });
+
+    test("Set value", () async {
+      await InvenTreeSettingsManager().setValue("abc", "xyz");
+
+      expect(await InvenTreeSettingsManager().getValue("abc", "123"), equals("xyz"));
     });
   });
 }
\ No newline at end of file
diff --git a/test/api_test.dart b/test/user_profile_test.dart
similarity index 96%
rename from test/api_test.dart
rename to test/user_profile_test.dart
index 9c28f716..5de1043e 100644
--- a/test/api_test.dart
+++ b/test/user_profile_test.dart
@@ -106,6 +106,8 @@ void main() {
         expect(p.password, equals("testpassword"));
         expect(p.server, equals("http://localhost:12345"));
 
+        expect(p.toString(), equals("<${p.key}> Test Profile : http://localhost:12345 - testuser:testpassword"));
+
         // Test that we can update the profile
         p.name = "different name";