mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-06-02 22:26:57 -05:00
* Stop using npm run migrate:reset in tests * Begin moving other existing fixtures to factories * Update cypress/support/index.ts Co-authored-by: Kalle <38327916+Sendouc@users.noreply.github.com> * Clean up usage of _.sample * Rename files * Remove incomplete building of associations * Add missing references to calendarEvent * Remove inaccurate seeds * Add explicit lodash devDependency Co-authored-by: Kalle <38327916+Sendouc@users.noreply.github.com>
22 lines
596 B
TypeScript
22 lines
596 B
TypeScript
import { Factory } from "fishery";
|
|
import { PlusStatus, PlusRegion } from "@prisma/client";
|
|
import prisma from "../client";
|
|
import _ from "lodash";
|
|
|
|
export default Factory.define<PlusStatus>(({ params, onCreate }) => {
|
|
onCreate(plusStatus => {
|
|
return prisma.plusStatus.create({ data: plusStatus });
|
|
});
|
|
|
|
return {
|
|
userId: 1, // TODO: automatically build a User object, if necessary
|
|
membershipTier: 1,
|
|
region: _.sample(Object.values(PlusRegion))!,
|
|
voucherId: null,
|
|
vouchTier: null,
|
|
canVouchFor: null,
|
|
canVouchAgainAfter: null,
|
|
nameForVoting: null
|
|
};
|
|
});
|