@@ -159,8 +159,15 @@ describe('Feed API', () => {
159159 expect ( firstEntry ) . to . include ( `<id>${ expected } </id>` ) ;
160160 } ) ;
161161
162- it ( 'has an alternate link to the version API endpoint' , ( ) => {
162+ it ( 'has an alternate link to the GitHub commit' , async ( ) => {
163+ const collection = await getCollection ( ) ;
163164 const href = firstEntry . match ( / < l i n k [ ^ > ] * r e l = " a l t e r n a t e " [ ^ > ] * h r e f = " ( [ ^ " ] + ) " / ) [ 1 ] ;
165+
166+ expect ( href ) . to . equal ( `${ collection . metadata . versions } /commit/${ savedVersions . technicalUpgradeRecord . id } ` ) ;
167+ } ) ;
168+
169+ it ( 'has a related link to the version API endpoint' , ( ) => {
170+ const href = firstEntry . match ( / < l i n k [ ^ > ] * r e l = " r e l a t e d " [ ^ > ] * h r e f = " ( [ ^ " ] + ) " / ) [ 1 ] ;
164171 const expectedPathFragment = `/version/${ encodeURIComponent ( 'service-2' ) } /${ encodeURIComponent ( 'Privacy Policy' ) } /${ encodeURIComponent ( toISODateWithoutMilliseconds ( FETCH_DATE_UPGRADE ) ) } ` ;
165172
166173 expect ( href ) . to . include ( expectedPathFragment ) ;
@@ -399,8 +406,8 @@ describe('Feed API', () => {
399406 expect ( href ) . to . not . include ( 'Service B!' ) ;
400407 } ) ;
401408
402- it ( 'URL-encodes spaces and special characters in entry alternate links' , ( ) => {
403- const href = response . text . match ( / < l i n k [ ^ > ] * r e l = " a l t e r n a t e " [ ^ > ] * h r e f = " ( [ ^ " ] + ) " / ) [ 1 ] ;
409+ it ( 'URL-encodes spaces and special characters in entry related links' , ( ) => {
410+ const href = response . text . match ( / < l i n k [ ^ > ] * r e l = " r e l a t e d " [ ^ > ] * h r e f = " ( [ ^ " ] + ) " / ) [ 1 ] ;
404411
405412 expect ( href ) . to . include ( 'Service%20B!' ) ;
406413 expect ( href ) . to . include ( 'Privacy%20Policy' ) ;
0 commit comments