This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
generated from KennethTrecy/web_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unit(database): ensure post tag manager works
- Loading branch information
Angelo Magtoto
committed
Oct 13, 2022
1 parent
1e3ac99
commit bc72ef8
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Factory from "~/factories/post_tag" | ||
import Manager from "./post_tag" | ||
|
||
describe("Database Manager: Post tag read operations", () => { | ||
it("can check if model belongs to post", async() => { | ||
const manager = new Manager() | ||
const model = await new Factory().insertOne() | ||
|
||
const foundModel = await manager.findPostTag(model.postID, model.tagID) | ||
|
||
expect(foundModel).not.toBeNull() | ||
expect(foundModel).toHaveProperty("id", model.id) | ||
}) | ||
}) | ||
|
||
describe("Database Manager: Miscellaneous post tag operations", () => { | ||
it("can get sortable columns", () => { | ||
// Include in test to alert in case there are new columns to decide whether to expose or not | ||
const manager = new Manager() | ||
|
||
const { sortableColumns } = manager | ||
|
||
expect(sortableColumns).toStrictEqual([]) | ||
}) | ||
}) |