feat: hotel technology landing page per owner brief
- new copy and sections for the five hotel services - form fields: name, work email, phone, company, service - reject free email providers on page and server - second form in the final CTA, mobile WhatsApp/call bar - schema: industry and message replaced by service Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfmHGGiYUjNcvJoyzdf
This commit is contained in:
1 parent
e73444e156
commit
c2ebee08df
5 files changed
+493
-257
No files matched your search
+18
-4
@@ -22,11 +22,10 @@ after(() => {
|
||||
|
||||
const valid = {
|
||||
name: 'Aisyah Rahman',
|
||||
email: 'aisyah@example.com',
|
||||
email: 'aisyah@seripinang.com.my',
|
||||
phone: '+60 12-345 6789',
|
||||
company: 'Hotel Seri Pinang',
|
||||
industry: 'Hospitality',
|
||||
message: 'Need guest Wi-Fi for 120 rooms',
|
||||
service: 'Cloud IP PABX',
|
||||
utm_source: 'google',
|
||||
referrer: 'https://www.google.com/',
|
||||
};
|
||||
@@ -58,6 +57,7 @@ test('valid lead is stored', async () => {
|
||||
assert.strictEqual(r.length, 1);
|
||||
assert.strictEqual(r[0].name, valid.name);
|
||||
assert.strictEqual(r[0].company, valid.company);
|
||||
assert.strictEqual(r[0].service, 'Cloud IP PABX');
|
||||
assert.strictEqual(r[0].utm_source, 'google');
|
||||
assert.strictEqual(r[0].referrer, 'https://www.google.com/');
|
||||
assert.ok(r[0].created_at);
|
||||
@@ -75,6 +75,20 @@ test('invalid email is rejected', async () => {
|
||||
assert.strictEqual((await post({ ...valid, email: 'abc' })).status, 400);
|
||||
});
|
||||
|
||||
test('free email providers are rejected with a friendly message', async () => {
|
||||
for (const email of ['a@gmail.com', 'a@Yahoo.com.my', 'a@hotmail.com', 'a@outlook.com', 'a@icloud.com']) {
|
||||
const res = await post({ ...valid, email });
|
||||
assert.strictEqual(res.status, 400, email);
|
||||
assert.match((await res.json()).error, /work email/i);
|
||||
}
|
||||
});
|
||||
|
||||
test('unknown service is rejected, missing service is allowed', async () => {
|
||||
assert.strictEqual((await post({ ...valid, service: 'Plumbing' })).status, 400);
|
||||
const { service, ...noService } = valid;
|
||||
assert.strictEqual((await post(noService)).status, 201);
|
||||
});
|
||||
|
||||
test('over-long field is rejected', async () => {
|
||||
assert.strictEqual((await post({ ...valid, name: 'x'.repeat(201) })).status, 400);
|
||||
});
|
||||
@@ -84,7 +98,7 @@ test('non-JSON body is rejected', async () => {
|
||||
});
|
||||
|
||||
test('oversized body is rejected', async () => {
|
||||
assert.strictEqual((await post({ ...valid, message: 'x'.repeat(11000) })).status, 413);
|
||||
assert.strictEqual((await post({ ...valid, company: 'x'.repeat(11000) })).status, 413);
|
||||
});
|
||||
|
||||
test('honeypot submission is accepted but not stored', async () => {
|
||||
|
||||
Reference in new issue
Block a user