sendou.ink/prisma/factories/plusVotingSummary.ts
Ryan Laughlin 15ff99bc9e
Start to fix tests + add more factories (#334)
* 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>
2021-04-01 23:32:19 +03:00

21 lines
549 B
TypeScript

import { Factory } from "fishery";
import { PlusVotingSummary } from "@prisma/client";
import prisma from "../client";
export default Factory.define<PlusVotingSummary>(({ params, onCreate }) => {
onCreate(plusVotingSummary => {
return prisma.plusVotingSummary.create({ data: plusVotingSummary });
});
return {
userId: 1, // TODO: automatically build a User object, if necessary
month: 1,
tier: 1,
year: 2020,
wasVouched: false,
wasSuggested: false,
countsEU: [0, 0, 0, 3],
countsNA: [0, 0, 2, 0]
};
});