feat(20-01): extend UIStore with FAB/catalog state, add useTags hook, update useGlobalItems
- Add fabMenuOpen, openFabMenu, closeFabMenu to UIStore - Add catalogSearchOpen, catalogSearchMode, openCatalogSearch, closeCatalogSearch - openCatalogSearch also closes FAB menu (natural flow) - Create useTags hook with 5-min staleTime cache - Add optional tags parameter to useGlobalItems for tag filtering
This commit is contained in:
@@ -36,10 +36,9 @@ describe("Tag Routes", () => {
|
||||
});
|
||||
|
||||
it("returns 200 with tag objects after seeding", async () => {
|
||||
await db.insert(tags).values([
|
||||
{ name: "bikepacking" },
|
||||
{ name: "ultralight" },
|
||||
]);
|
||||
await db
|
||||
.insert(tags)
|
||||
.values([{ name: "bikepacking" }, { name: "ultralight" }]);
|
||||
|
||||
const res = await app.request("/api/tags");
|
||||
expect(res.status).toBe(200);
|
||||
|
||||
@@ -17,11 +17,13 @@ describe("Tag Service", () => {
|
||||
});
|
||||
|
||||
it("returns all tags as { id, name } ordered alphabetically", async () => {
|
||||
await db.insert(tags).values([
|
||||
{ name: "bikepacking" },
|
||||
{ name: "ultralight" },
|
||||
{ name: "accessories" },
|
||||
]);
|
||||
await db
|
||||
.insert(tags)
|
||||
.values([
|
||||
{ name: "bikepacking" },
|
||||
{ name: "ultralight" },
|
||||
{ name: "accessories" },
|
||||
]);
|
||||
|
||||
const result = await getAllTags(db);
|
||||
expect(result).toHaveLength(3);
|
||||
|
||||
Reference in New Issue
Block a user