mirror of
https://github.com/inventree/inventree-app.git
synced 2025-07-01 19:30:44 +00:00
Format Code and Add Format Checks to CI (#643)
* Remove unused lib/generated/i18n.dart * Use `fvm dart format .` * Add contributing guidelines * Enforce dart format * Add `dart format off` directive to generated files
This commit is contained in:
@ -26,11 +26,13 @@ void main() {
|
||||
expect(profiles.length, equals(0));
|
||||
|
||||
// Now, create one!
|
||||
bool result = await UserProfileDBManager().addProfile(UserProfile(
|
||||
name: testServerName,
|
||||
server: testServerAddress,
|
||||
selected: true,
|
||||
));
|
||||
bool result = await UserProfileDBManager().addProfile(
|
||||
UserProfile(
|
||||
name: testServerName,
|
||||
server: testServerAddress,
|
||||
selected: true,
|
||||
),
|
||||
);
|
||||
|
||||
expect(result, equals(true));
|
||||
|
||||
@ -56,20 +58,15 @@ void main() {
|
||||
|
||||
// Run a set of tests for user profile functionality
|
||||
group("Profile Tests:", () {
|
||||
|
||||
test("Add Invalid Profiles", () async {
|
||||
// Add a profile with missing data
|
||||
bool result = await UserProfileDBManager().addProfile(
|
||||
UserProfile()
|
||||
);
|
||||
bool result = await UserProfileDBManager().addProfile(UserProfile());
|
||||
|
||||
expect(result, equals(false));
|
||||
|
||||
// Add a profile with a new name
|
||||
result = await UserProfileDBManager().addProfile(
|
||||
UserProfile(
|
||||
name: "Another Test Profile",
|
||||
)
|
||||
UserProfile(name: "Another Test Profile"),
|
||||
);
|
||||
|
||||
expect(result, equals(true));
|
||||
@ -81,7 +78,9 @@ void main() {
|
||||
});
|
||||
|
||||
test("Profile Name Check", () async {
|
||||
bool result = await UserProfileDBManager().profileNameExists("doesnotexist");
|
||||
bool result = await UserProfileDBManager().profileNameExists(
|
||||
"doesnotexist",
|
||||
);
|
||||
expect(result, equals(false));
|
||||
|
||||
result = await UserProfileDBManager().profileNameExists("Test Server");
|
||||
@ -100,7 +99,10 @@ void main() {
|
||||
expect(p.name, equals(testServerName));
|
||||
expect(p.server, equals(testServerAddress));
|
||||
|
||||
expect(p.toString(), equals("<${p.key}> Test Server : http://localhost:8000/"));
|
||||
expect(
|
||||
p.toString(),
|
||||
equals("<${p.key}> Test Server : http://localhost:8000/"),
|
||||
);
|
||||
|
||||
// Test that we can update the profile
|
||||
p.name = "different name";
|
||||
@ -110,5 +112,4 @@ void main() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user