mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Adds basic unit tests for part category
This commit is contained in:
parent
8ee10a3424
commit
b40a0f8dad
1 changed files with 27 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue