fix(marketing): trust bar accuracy + WCAG AA contrast + LPC art. 219 hygiene
- Critical (C1): align 9-ordre list with dictia.ca canonical (Barreau, CNQ, CPA, ChAD, OACIQ, CMQ, OIIQ, OPQ, OEQ). Drop ambiguous OPPQ; replace M/P short monograms with disambiguated 3-5 char abbreviations (BAR, CNQ, CPA, ChAD, OACIQ, CMQ, OIIQ, OPQ, OEQ). Tooltips show full disambiguating names. - Critical (C2): raise text-brand-navy/40 -> /70 on footnote (2.69:1 -> 9:1 contrast, passes WCAG AAA) and text-[10px] navy/50 -> text-xs navy/70 on monogram captions (12px minimum + AA contrast). Critical for legal disclosure legibility. - Critical (C3): drop unverifiable '50 heures' specific number from methodology footnote — replaced with 'methodologie disponible sur demande' (defensible without committing to numbers we can't verify). - Important (I1): use before %/$ in KPI numbers per OQLF French typography rules + |safe filter to render entities. - Important (I2): replace fragile substring-strip test with explicit forbidden-phrase list (RECONNU PAR, ENDOSSÉ PAR, etc.). Update ordre list test + footnote test to match new wording.
This commit is contained in:
@@ -144,31 +144,42 @@ def test_hero_eyebrow_has_brand_messaging():
|
||||
|
||||
|
||||
def test_trust_bar_has_9_ordres_pros():
|
||||
"""Trust bar lists all 9 ordres professionnels by name."""
|
||||
"""Trust bar lists all 9 canonical Quebec ordres pros (matches dictia.ca)."""
|
||||
client = app.test_client()
|
||||
body = client.get('/').data.decode('utf-8')
|
||||
for ordre in ['Barreau', 'Notaires', 'CPA Québec', 'ChAD', 'OACIQ', 'CMQ', 'OIIQ', 'OPPQ', 'OPQ']:
|
||||
for ordre in ['Barreau', 'Chambre des notaires', 'CPA Québec', 'ChAD', 'OACIQ', 'CMQ', 'OIIQ', 'OPQ', 'OEQ']:
|
||||
assert ordre in body, f"Missing ordre pro: {ordre}"
|
||||
# Note: OPPQ deliberately removed (ambiguous abbrev — replaced with OPQ for Pharmaciens)
|
||||
|
||||
|
||||
def test_trust_bar_has_eyebrow_factual_phrasing():
|
||||
"""Trust bar eyebrow uses 'MAPPÉ AUX' (factual scope) not 'CERTIFIÉ PAR' (false endorsement)."""
|
||||
"""Trust bar avoids false-endorsement language (LPC art. 219 / Competition Act s. 52)."""
|
||||
client = app.test_client()
|
||||
body = client.get('/').data.decode('utf-8')
|
||||
assert 'MAPP' in body and '9 ORDRES PROFESSIONNELS' in body, "Missing factual eyebrow"
|
||||
# Ensure we don't claim official certification
|
||||
assert 'CERTIFI' not in body.replace('CERTIFIE PAR', '').replace('CERTIFIÉ PAR', ''), \
|
||||
"Avoid claiming certification — we map to ordres, we don't claim endorsement"
|
||||
# Forbidden marketing phrases that imply official endorsement we don't have
|
||||
forbidden = [
|
||||
'CERTIFIÉ PAR',
|
||||
'CERTIFIE PAR',
|
||||
'ENDOSSÉ PAR',
|
||||
'APPROUVÉ PAR',
|
||||
'RECONNU PAR',
|
||||
'AVALISÉ PAR',
|
||||
]
|
||||
body_upper = body.upper()
|
||||
for phrase in forbidden:
|
||||
assert phrase not in body_upper, f"Forbidden marketing claim found: {phrase}"
|
||||
|
||||
|
||||
def test_trust_bar_has_4_kpis_with_grad_text():
|
||||
"""Trust bar has 4 KPI metrics rendered with grad-text."""
|
||||
"""Trust bar has 4 KPI metrics rendered with grad-text (NBSP per OQLF typography)."""
|
||||
client = app.test_client()
|
||||
body = client.get('/').data.decode('utf-8')
|
||||
assert '~5 min' in body
|
||||
assert '95 %+' in body or '95%+' in body
|
||||
assert '0 $' in body
|
||||
assert '100 %' in body or '100%' in body
|
||||
# OQLF: non-breaking space before %/$ via entity
|
||||
assert '95 %+' in body, "Missing NBSP-separated 95%+ KPI"
|
||||
assert '0 $' in body, "Missing NBSP-separated 0$ KPI"
|
||||
assert '100 %' in body, "Missing NBSP-separated 100% KPI"
|
||||
# Verify grad-text on KPI numbers
|
||||
assert 'grad-text mb-2' in body, "Missing grad-text on KPI numbers"
|
||||
|
||||
@@ -177,7 +188,7 @@ def test_trust_bar_has_methodology_footnote():
|
||||
"""95%+ claim has a defensible methodology footnote (LPC art. 219 hygiene)."""
|
||||
client = app.test_client()
|
||||
body = client.get('/').data.decode('utf-8')
|
||||
# Look for the methodology disclosure
|
||||
assert 'test interne' in body, "Missing 'test interne' attribution on 95% claim"
|
||||
assert 'détails disponibles sur demande' in body or 'détails disponibles sur demande' in body, \
|
||||
"Missing methodology disclosure footnote"
|
||||
# Verifiable wording: no specific hour count, methodology available on request
|
||||
assert 'méthodologie disponible sur demande' in body or 'méthodologie disponible sur demande' in body
|
||||
assert 'audio professionnel québécois' in body or 'audio professionnel québécois' in body
|
||||
assert 'info@dictia.ca' in body
|
||||
|
||||
Reference in New Issue
Block a user