Skip to content

Commit

Permalink
feat: LC-65 extend unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszbilka committed Aug 18, 2024
1 parent b38b2ed commit 09ba3fa
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apps/api/src/categories/__tests__/categories.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,15 @@ describe("CategoriesService", () => {
expect(filterCategories.data).toHaveLength(1);
});
});

describe("archiveCategory", () => {
it("admin can archive a category", async () => {
const cat = await db.select().from(categories);
const result = await categoriesServics.archiveCategory(
cat[0].id,
UserRoles.admin,
);
expect(result.archivedAt).not.toBeNull();
});
});
});

0 comments on commit 09ba3fa

Please sign in to comment.