2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 05:26:47 +00:00

Extra tests

This commit is contained in:
Oliver Walters 2022-05-21 20:41:03 +10:00
parent ee3b7502dc
commit 253a75129a
2 changed files with 11 additions and 0 deletions

View File

@ -16,6 +16,15 @@ void main() {
// Boolean values // Boolean values
expect(await InvenTreeSettingsManager().getBool("test", false), equals(false)); expect(await InvenTreeSettingsManager().getBool("test", false), equals(false));
expect(await InvenTreeSettingsManager().getBool("test", true), equals(true)); 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"));
}); });
}); });
} }

View File

@ -106,6 +106,8 @@ void main() {
expect(p.password, equals("testpassword")); expect(p.password, equals("testpassword"));
expect(p.server, equals("http://localhost:12345")); 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 // Test that we can update the profile
p.name = "different name"; p.name = "different name";