恢复付款入口与常开基线(08-01-reimbursement-notification-progress-clarity)
这个提交包含在:
@@ -1,8 +1,10 @@
|
||||
const {
|
||||
DEFAULT_APPROVAL_RULES,
|
||||
DEFAULT_FEATURE_FLAGS,
|
||||
ENABLED_EXPENSE_TYPES,
|
||||
seedApprovalRules,
|
||||
seedExpenseTypes,
|
||||
seedFeatureFlags,
|
||||
} = require("../../../src/scripts/seed-config");
|
||||
|
||||
describe("default travel expense types", () => {
|
||||
@@ -108,3 +110,35 @@ describe("small-team default reimbursement approval rules", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("trialrun payment batch baseline", () => {
|
||||
it("creates payment_batch_v1 as globally enabled", () => {
|
||||
expect(DEFAULT_FEATURE_FLAGS).toContainEqual({
|
||||
flag_key: "payment_batch_v1",
|
||||
override_mode: "force_on",
|
||||
rollout_type: "global",
|
||||
department_ids: [],
|
||||
note: "bootstrap default: force_on",
|
||||
});
|
||||
});
|
||||
|
||||
it("preserves an existing payment flag instead of overwriting it", async () => {
|
||||
const create = vi.fn(async ({ data }) => {
|
||||
if (data.flag_key === "payment_batch_v1") {
|
||||
throw Object.assign(new Error("unique conflict"), { code: "P2002" });
|
||||
}
|
||||
return data;
|
||||
});
|
||||
const prisma = { featureFlag: { create } };
|
||||
|
||||
await expect(seedFeatureFlags(prisma)).resolves.toBeUndefined();
|
||||
expect(create).toHaveBeenCalledWith({
|
||||
data: expect.objectContaining({
|
||||
flag_key: "payment_batch_v1",
|
||||
override_mode: "force_on",
|
||||
}),
|
||||
});
|
||||
expect(prisma.featureFlag.update).toBeUndefined();
|
||||
expect(prisma.featureFlag.upsert).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
在新工单中引用
屏蔽一个用户