Commit 32 of 51:
cbbc2bd88a
feat(coaching): say what a tier includes, not only how the coach trains
previous
next
whole branch
Review threads live on the whole diff, not on one commit, so
none are shown here - a thread's line means something in the
branch's final form, and painting it into an intermediate
step would put it on code it is not about.
public/assets/styles/production/coaching.css modified +1 -0 Changes to public/assets/styles/production/coaching.css ⋯ 76 lines Show the 76 lines above this hunk @@ -77,6 +77,7 @@77 77 .coaching-surface .coach-offer-price { text-align : right ; white-space : nowrap} 78 78 .coaching-surface .coach-offer-price b { display : block ; font : 400 clamp(22px,2.4vw,30px)/1.1 var(--lsu-display) ; font-weight : 400 } 79 79 .coaching-surface .coach-offer-trial { display : block ; margin-top : 8 px ; color : var(--lsu-dim-3) ; font : 400 13 px/1.4 var(--lsu-body)} 80 + .coaching-surface .coach-offer-method { color : var(--lsu-dim-2) ; font-size : 15 px} 80 81 .coaching-surface .coach-offer-note { margin : 14 px 0 0 ; color : var(--lsu-dim-3) ; font : 400 13 px/1.5 var(--lsu-body)} 81 82 82 83
resources/assets/styles/site/coaching.css modified +1 -0 Changes to resources/assets/styles/site/coaching.css ⋯ 76 lines Show the 76 lines above this hunk @@ -77,6 +77,7 @@77 77 .coaching-surface .coach-offer-price { text-align : right ; white-space : nowrap} 78 78 .coaching-surface .coach-offer-price b { display : block ; font : 400 clamp(22px,2.4vw,30px)/1.1 var(--lsu-display) ; font-weight : 400 } 79 79 .coaching-surface .coach-offer-trial { display : block ; margin-top : 8 px ; color : var(--lsu-dim-3) ; font : 400 13 px/1.4 var(--lsu-body)} 80 + .coaching-surface .coach-offer-method { color : var(--lsu-dim-2) ; font-size : 15 px} 80 81 .coaching-surface .coach-offer-note { margin : 14 px 0 0 ; color : var(--lsu-dim-3) ; font : 400 13 px/1.5 var(--lsu-body)} 81 82 82 83
resources/components/CoachingOffers.stx modified +18 -2 Changes to resources/components/CoachingOffers.stx ⋯ 22 lines Show the 22 lines above this hunk @@ -23,10 +23,21 @@ const offerHost = portalHost() 23 23 Getting it wrong is an h1 followed by an h3 , which is how a screen - reader 24 24 user loses the outline of the page . * / 25 25 const offerTop = String ( level ) = = = '2' 26 + 27 + / * Two different things , and a storefront needs both : what this tier gives you 28 + ( the coach 's product description) and how the coach trains people (their 29 + published method summary ) . HQ sometimes carries the same sentence in both , 30 + so the second is dropped when it repeats the first rather than printing a 31 + paragraph twice . * / 32 + const offerRows = offers . map ( ( offer ) = > { 33 + const includes = offer . product . description . trim ( ) 34 + const approach = offer . method . summary . trim ( ) 35 + return { . . . offer , includes , approach : approach & & approach ! = = includes ? approach : '' } 36 + } ) 26 37 < / script > 27 38 @ if ( offers . length > 0 ) 28 39 < ul class = "coach-offers" > 29 - @ foreach ( offers as offer ) 40 + @ foreach ( offerRows as offer ) 30 41 < li class = "coach-offer" > 31 42 < div > 32 43 @ if ( offerTop ) ⋯ 2 lines Show the 2 lines above this hunk @@ -35,7 +46,12 @@ const offerTop = String(level) === '2' 35 46 < h3 class = "coach-offer-name" > { { offer . label } } < / h3 > 36 47 @ endif 37 48 < p class = "coach-offer-by" > { { offer . coach } } < / p > 38 - < p > { { offer . method . summary } } < / p > 49 + @ if ( offer . includes ) 50 + < p > { { offer . includes } } < / p > 51 + @ endif 52 + @ if ( offer . approach ) 53 + < p class = "coach-offer-method" > { { offer . approach } } < / p > 54 + @ endif 39 55 < p class = "coach-offer-note" > { { offer . method . name } } , version { { offer . method . version } } . Bought and billed at { { offerHost } } . < / p > 40 56 < / div > 41 57 < div class = "coach-offer-price" >
tests/coaching-views.test.ts modified +20 -0 Changes to tests/coaching-views.test.ts ⋯ 195 lines Show the 195 lines above this hunk @@ -196,3 +196,23 @@ describe('warming the connection to HQ', () => { 196 196 expect ( html . indexOf ( 'rel="preconnect"' ) ) . toBeLessThan ( html . indexOf ( 'hq-coaching.js' ) ) 197 197 } ) 198 198 } ) 199 + 200 + describe ( 'what a tier says it is' , ( ) => { 201 + it ( 'prints what the tier includes and how the coach trains' , async ( ) => { 202 + stubHq ( ) 203 + const plans = await render ( 'plans' ) 204 + 205 + expect ( plans ) . toContain ( '€19.99 is a sample price' ) 206 + expect ( plans ) . toContain ( 'Demonstration content, not an approved LSU coach method.' ) 207 + } ) 208 + 209 + it ( 'prints one paragraph when HQ carries the same sentence in both' , async ( ) => { 210 + const same = structuredClone ( payload ) 211 + same . offers [ 0 ] . method . summary = same . offers [ 0 ] . product . description 212 + stubHq ( same ) 213 + const plans = await render ( 'plans' ) 214 + 215 + expect ( plans ) . not . toContain ( 'coach-offer-method' ) 216 + expect ( [ ... plans . matchAll ( / sample price / g ) ] ) . toHaveLength ( 1 ) 217 + } ) 218 + } )