Skip to content

Commit 726090d

Browse files
fix: associate AI contact form labels
1 parent e9cc00f commit 726090d

3 files changed

Lines changed: 69 additions & 20 deletions

File tree

ia-agentique/en/index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -283,16 +283,16 @@ <h2 class="section-title text-foreground mb-5 font-display">Start with free coac
283283
<h3 class="font-bold text-xl mb-6 font-display text-center">Choose the agent or free coaching</h3>
284284
<form action="mailto:laslyalexandre@gmail.com" method="POST" enctype="text/plain" class="space-y-4">
285285
<div>
286-
<label class="block text-sm font-semibold text-foreground mb-1">Your name *</label>
287-
<input type="text" name="nom" required class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
286+
<label for="customer-name" class="block text-sm font-semibold text-foreground mb-1">Your name *</label>
287+
<input id="customer-name" type="text" name="name" autocomplete="name" required class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
288288
</div>
289289
<div>
290-
<label class="block text-sm font-semibold text-foreground mb-1">Your email *</label>
291-
<input type="email" name="email" required class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
290+
<label for="customer-email" class="block text-sm font-semibold text-foreground mb-1">Your email *</label>
291+
<input id="customer-email" type="email" name="email" autocomplete="email" required class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
292292
</div>
293293
<div>
294-
<label class="block text-sm font-semibold text-foreground mb-1">Company / Project</label>
295-
<input type="text" name="entreprise" class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
294+
<label for="customer-project" class="block text-sm font-semibold text-foreground mb-1">Company / Project</label>
295+
<input id="customer-project" type="text" name="company" autocomplete="organization" class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
296296
</div>
297297
<div>
298298
<label for="offer-select" class="block text-sm font-semibold text-foreground mb-1">Selected offer *</label>
@@ -304,12 +304,12 @@ <h3 class="font-bold text-xl mb-6 font-display text-center">Choose the agent or
304304
<p id="offer-prefill-status" class="mt-2 text-sm font-semibold text-primary" aria-live="polite"></p>
305305
</div>
306306
<div>
307-
<label class="block text-sm font-semibold text-foreground mb-1">Describe your need *</label>
308-
<textarea name="besoin" rows="4" required class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all resize-y"></textarea>
307+
<label for="customer-need" class="block text-sm font-semibold text-foreground mb-1">Describe your need *</label>
308+
<textarea id="customer-need" name="need" rows="4" required class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all resize-y"></textarea>
309309
</div>
310310
<div>
311-
<label class="block text-sm font-semibold text-foreground mb-1">Preferred platform</label>
312-
<select name="plateforme" class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
311+
<label for="preferred-platform" class="block text-sm font-semibold text-foreground mb-1">Preferred platform</label>
312+
<select id="preferred-platform" name="platform" class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
313313
<option value="">-- Choose --</option>
314314
<option value="Web UI + Telegram">Web UI + Telegram</option>
315315
<option value="Telegram">Telegram</option>

ia-agentique/index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,16 @@ <h2 class="section-title text-foreground mb-5 font-display">Commencez par un coa
300300
<h3 class="font-bold text-xl mb-6 font-display text-center">Choisir l'agent ou le coaching gratuit</h3>
301301
<form action="mailto:laslyalexandre@gmail.com" method="POST" enctype="text/plain" class="space-y-4">
302302
<div>
303-
<label class="block text-sm font-semibold text-foreground mb-1">Votre nom *</label>
304-
<input type="text" name="nom" required class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
303+
<label for="customer-name" class="block text-sm font-medium mb-2">Votre nom *</label>
304+
<input id="customer-name" type="text" name="nom" autocomplete="name" required class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
305305
</div>
306306
<div>
307-
<label class="block text-sm font-semibold text-foreground mb-1">Votre email *</label>
308-
<input type="email" name="email" required class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
307+
<label for="customer-email" class="block text-sm font-semibold text-foreground mb-1">Votre email *</label>
308+
<input id="customer-email" type="email" name="email" autocomplete="email" required class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
309309
</div>
310310
<div>
311-
<label class="block text-sm font-semibold text-foreground mb-1">Entreprise / Projet</label>
312-
<input type="text" name="entreprise" class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
311+
<label for="customer-project" class="block text-sm font-semibold text-foreground mb-1">Entreprise / Projet</label>
312+
<input id="customer-project" type="text" name="entreprise" autocomplete="organization" class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
313313
</div>
314314
<div>
315315
<label for="offer-select" class="block text-sm font-semibold text-foreground mb-1">Offre souhaitée *</label>
@@ -321,12 +321,12 @@ <h3 class="font-bold text-xl mb-6 font-display text-center">Choisir l'agent ou l
321321
<p id="offer-prefill-status" class="mt-2 text-sm font-semibold text-primary" aria-live="polite"></p>
322322
</div>
323323
<div>
324-
<label class="block text-sm font-semibold text-foreground mb-1">Décrivez votre besoin *</label>
325-
<textarea name="besoin" rows="4" required class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all resize-y"></textarea>
324+
<label for="customer-need" class="block text-sm font-semibold text-foreground mb-1">Décrivez votre besoin *</label>
325+
<textarea id="customer-need" name="besoin" rows="4" required class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all resize-y"></textarea>
326326
</div>
327327
<div>
328-
<label class="block text-sm font-semibold text-foreground mb-1">Plateforme préférée</label>
329-
<select name="plateforme" class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
328+
<label for="preferred-platform" class="block text-sm font-semibold text-foreground mb-1">Plateforme préférée</label>
329+
<select id="preferred-platform" name="plateforme" class="w-full px-4 py-3 rounded-xl border border-border bg-white text-foreground focus:border-primary focus:ring-2 focus:ring-blue-500/20 outline-none transition-all">
330330
<option value="">-- Choisir --</option>
331331
<option value="Web UI + Telegram">Web UI + Telegram</option>
332332
<option value="Telegram">Telegram</option>

tests/test_ia_agentique_pricing.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,56 @@ def test_offer_links_prefill_the_matching_form_option(
259259
assert f"coaching: '{coaching_value}'" in html
260260
assert "Object.prototype.hasOwnProperty.call(offers, selectedOffer)" in html
261261
assert "offerSelect.value = offers[selectedOffer]" in html
262+
assert "status.textContent =" in html
262263
assert status_copy in html
263264

264265
assert "Formulaire sécurisé" not in html
265266
assert "Secure form" not in html
267+
268+
269+
@pytest.mark.parametrize(
270+
("relative_path", "fields"),
271+
[
272+
(
273+
"ia-agentique/index.html",
274+
(
275+
("customer-name", "nom"),
276+
("customer-email", "email"),
277+
("customer-project", "entreprise"),
278+
("offer-select", "offre"),
279+
("customer-need", "besoin"),
280+
("preferred-platform", "plateforme"),
281+
),
282+
),
283+
(
284+
"ia-agentique/en/index.html",
285+
(
286+
("customer-name", "name"),
287+
("customer-email", "email"),
288+
("customer-project", "company"),
289+
("offer-select", "offre"),
290+
("customer-need", "need"),
291+
("preferred-platform", "platform"),
292+
),
293+
),
294+
],
295+
)
296+
def test_contact_form_labels_are_associated_with_their_controls(relative_path, fields):
297+
html = (ROOT / relative_path).read_text(encoding="utf-8")
298+
299+
for control_id, field_name in fields:
300+
assert f'<label for="{control_id}"' in html
301+
control = re.search(
302+
rf'<(?:input|select|textarea)[^>]*id="{re.escape(control_id)}"[^>]*name="{re.escape(field_name)}"',
303+
html,
304+
)
305+
assert control is not None
306+
307+
assert 'id="customer-name" type="text" name=' in html
308+
assert 'autocomplete="name"' in html
309+
assert 'id="customer-email" type="email" name="email" autocomplete="email"' in html
310+
assert 'id="customer-project" type="text" name=' in html
311+
assert 'autocomplete="organization"' in html
312+
313+
assert "Formulaire sécurisé" not in html
314+
assert "Secure form" not in html

0 commit comments

Comments
 (0)