fix: resolve all 13 remaining test failures
Some checks failed
CI / ci (push) Failing after 56s
CI / e2e (push) Has been skipped

- OAuth: add userId to oauth_codes schema and migration, derive userId
  from stored auth code/token record instead of passing separately
- Auth middleware tests: destructure {db, userId} from createTestDb,
  pass userId to createApiKey, fix error message assertion
- MCP tests: add missing await on getCollectionSummary and
  createSecondTestUser calls

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 20:25:41 +02:00
parent c0f9d5c4d0
commit 7dbbfcb915
6 changed files with 30 additions and 17 deletions

View File

@@ -57,6 +57,7 @@ export const items = pgTable("items", {
quantity: integer("quantity").notNull().default(1),
globalItemId: integer("global_item_id").references(() => globalItems.id),
purchasePriceCents: integer("purchase_price_cents"),
brand: text("brand"),
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at").defaultNow().notNull(),
});
@@ -210,6 +211,9 @@ export const oauthCodes = pgTable("oauth_codes", {
id: serial("id").primaryKey(),
code: text("code").notNull().unique(),
clientId: text("client_id").notNull(),
userId: integer("user_id")
.notNull()
.references(() => users.id),
codeChallenge: text("code_challenge").notNull(),
codeChallengeMethod: text("code_challenge_method").notNull().default("S256"),
redirectUri: text("redirect_uri").notNull(),