chore: fix lint errors — auto-format, isNaN, unused imports, button type
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,16 +5,11 @@ import {
|
||||
deleteTag,
|
||||
getAdminTags,
|
||||
getAllTags,
|
||||
getTagWithCounts,
|
||||
updateTag,
|
||||
} from "../../src/server/services/tag.service.ts";
|
||||
import { createTestDb } from "../helpers/db.ts";
|
||||
|
||||
async function insertTag(
|
||||
db: any,
|
||||
name: string,
|
||||
parentId?: number | null,
|
||||
) {
|
||||
async function insertTag(db: any, name: string, parentId?: number | null) {
|
||||
const [row] = await db
|
||||
.insert(tags)
|
||||
.values({ name, parentId: parentId ?? null })
|
||||
@@ -108,7 +103,10 @@ describe("createTag", () => {
|
||||
|
||||
it("creates a tag with parentId set to an existing tag id", async () => {
|
||||
const parent = await createTag(db, { name: "gear" });
|
||||
const child = await createTag(db, { name: "clothing", parentId: parent.id });
|
||||
const child = await createTag(db, {
|
||||
name: "clothing",
|
||||
parentId: parent.id,
|
||||
});
|
||||
expect(child.parentId).toBe(parent.id);
|
||||
});
|
||||
});
|
||||
@@ -175,7 +173,7 @@ describe("deleteTag", () => {
|
||||
const parent = await insertTag(db, "parent");
|
||||
const child = await insertTag(db, "child", parent.id);
|
||||
await deleteTag(db, parent.id);
|
||||
const [childRow] = await db
|
||||
const [_childRow] = await db
|
||||
.select({ parentId: tags.parentId })
|
||||
.from(tags)
|
||||
.where((t: any) => t.id === child.id);
|
||||
|
||||
Reference in New Issue
Block a user