2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-27 21:16:48 +00:00

Adds basic unit tests for part category

This commit is contained in:
Oliver Walters 2022-06-03 21:23:22 +10:00
parent 8ee10a3424
commit b40a0f8dad

View File

@ -25,6 +25,33 @@ void main() {
assert(await InvenTreeAPI().connectToServer());
});
group("Category Tests:", () {
test("Basics", () async {
assert(InvenTreePartCategory().URL == "part/category/");
});
test("List Categories", () async {
List<InvenTreeModel> results;
// List *all* categories
results = await InvenTreePartCategory().list();
assert(results.length == 8);
for (var result in results) {
assert(result is InvenTreePartCategory);
}
// Filter by parent category
results = await InvenTreePartCategory().list(
filters: {
"parent": "1",
}
);
assert(results.length == 3);
});
});
group("Part Tests:", () {
test("Basics", () async {