mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 21:10:59 +00:00
test(import): answer the MANUAL-type lookup in the import mocks
This commit is contained in:
1 parent
67e8e7c4f2
commit
bc0d9f915f
2 files changed
+16
No files matched your search
@@ -271,6 +271,21 @@ function makeFakePrisma(
|
||||
}
|
||||
return returned;
|
||||
},
|
||||
// The import reads once which types hold MANUAL rows.
|
||||
groupBy: async ({
|
||||
where,
|
||||
}: {
|
||||
where: { userId: string; source: string };
|
||||
}) =>
|
||||
[
|
||||
...new Set(
|
||||
measurements
|
||||
.filter(
|
||||
(m) => m.userId === where.userId && m.source === where.source,
|
||||
)
|
||||
.map((m) => m.type),
|
||||
),
|
||||
].map((type) => ({ type })),
|
||||
findMany: async ({
|
||||
where,
|
||||
}: {
|
||||
|
||||
@@ -297,6 +297,7 @@ function makeDiscardingPrisma(sample: () => void) {
|
||||
externalId: row.externalId,
|
||||
}));
|
||||
},
|
||||
groupBy: async () => [],
|
||||
findMany: async () => [],
|
||||
findFirst: async () => null,
|
||||
update: async () => {
|
||||
|
||||
Reference in new issue
Block a user