Add configurable free euro amounts and multiline appointment preferences

This commit is contained in:
parkel committed 2026-11-18 16:28:35 +01:00
1 parent 93520382bb
commit 7713955795
11 files changed
+87 -22

No files matched your search

+6
View File
@@ -62,10 +62,16 @@ fs.mkdirSync(artifacts, { recursive: true, mode: 0o700 });
assert.equal(await page.locator('[data-hgcf-field=service]').isVisible(), true);
assert.equal(await page.locator('[name=mlhc_message]').getAttribute('required'), null);
const config=JSON.parse(await page.locator('.mlhc-form').getAttribute('data-hgcf-workflows')).request;
if(config.timeMode==='text'){assert.equal(await page.locator('#mlhc-preferences').isVisible(),true);assert.equal(await page.locator('#mlhc-daypart').isDisabled(),true);await page.locator('#mlhc-preferences').fill('Monday afternoon\nWednesday after 16:00\nFriday morning');}
assert.equal(config.services.at(-1).value,'unsure');
if(config.timeMode==='daypart'){assert.equal(await page.locator('#mlhc-daypart').isVisible(),true);assert.equal(await page.locator('#mlhc-time').isDisabled(),true);await page.locator('#mlhc-daypart').selectOption(Object.keys(config.dayparts)[0]);assert.equal(await page.locator('#mlhc-daypart').getAttribute('required'),null);}
await page.locator('[name=mlhc_mode][value=question]').check();
}
const giftMode=page.locator('[name=mlhc_mode][value=gift]');const configs=JSON.parse(await page.locator('.mlhc-form').getAttribute('data-hgcf-workflows'));
if(await giftMode.count()&&configs.gift.serviceMode==='amount'){
await giftMode.check();assert.equal(await page.locator('#mlhc-amount').isVisible(),true);assert.equal(await page.locator('#mlhc-massage').isDisabled(),true);await page.locator('#mlhc-amount').fill('37,50');
assert.equal(await page.locator('form.mlhc-form').evaluate(f=>new FormData(f).get('mlhc_massage')),'37,50');await page.locator('[name=mlhc_mode][value=question]').check();
}
const geometry = await widget.boundingBox();
assert(geometry.x >= 0 && geometry.x + geometry.width <= (mobile ? 390 : 1440));
await page.locator('.hgcf-contact').screenshot({ path: path.join(artifacts, `form-${lang}-${mobile ? 'mobile' : 'desktop'}.png`) });