Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
unit(database): ensure post tag manager works
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelo Magtoto committed Oct 13, 2022
1 parent 1e3ac99 commit bc72ef8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions database/managers/post_tag.spec.ts
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([])
})
})

0 comments on commit bc72ef8

Please sign in to comment.