import pick from "../../helpers/pick";
export default async function findTest(db, { id, flowId }, filterKeys) {
  const data = await db.find(`/flows/${flowId}/tests`, id);
  if (!data)
    return null;
  const test = {
    ...data,
    id,
  };
  return filterKeys ? pick(test, filterKeys) : test;
}
