Skip to content

Commit

Permalink
test: by default, validate cgus
Browse files Browse the repository at this point in the history
  • Loading branch information
vjousse committed Nov 14, 2023
1 parent 03db67d commit 1d3da9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions e2e/step_definitions/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const { v4: uuid4 } = require('uuid');
async function loginStub(userType, email) {
const uuid = uuid4();
const type = USER_TYPES.filter((t) => t.value === userType)[0];
const now = new Date().toISOString();

if (type.code === 'beneficiary') {
const result = await I.sendQuery(
`
Expand All @@ -18,7 +20,7 @@ async function loginStub(userType, email) {
await I.sendMutation(
`
mutation createAccount($id: uuid!) {
insert_account_one(object: {beneficiaryId: $id, accessKey: "${uuid}", type: beneficiary, username: "stifour", onboardingDone: true, confirmed: true}) { id}
insert_account_one(object: {beneficiaryId: $id, accessKey: "${uuid}", type: beneficiary, username: "stifour", onboardingDone: true, confirmed: true, cguValidatedAt: "${now}"}) { id}
}`,
{ id: result.data.data.beneficiary[0].id }
);
Expand Down Expand Up @@ -79,7 +81,7 @@ async function onBoardingSetup(userType, email, onBoardingDone) {
const type = USER_TYPES.filter((t) => t.value === userType)[0];
return await I.sendMutation(
`mutation SetupOnboardingFlag {
update_account(where: {${type.code}: {email: {_eq: "${email}"}}}, _set: {onboardingDone: ${onBoardingDone}}) {
update_account(where: {${type.code}: {email: {_eq: "${email}"}}}, _set: {onboardingDone: ${onBoardingDone}) {
affected_rows
}
}`
Expand Down

0 comments on commit 1d3da9c

Please sign in to comment.