@@ -77,7 +77,9 @@ describe("public-site contract", () => {
7777 } ) ;
7878
7979 it ( "publishes a real-app large social card and local TestFlight card" , async ( ) => {
80- const socialUrl = "https://pyble.dev/social/pyble-beta-og-1200x630.png" ;
80+ const socialPngName = "pyble-beta-og-7e7e037d-1200x630.png" ;
81+ const socialSvgName = "pyble-beta-og-48d458bd-1200x630.svg" ;
82+ const socialUrl = `https://pyble.dev/social/${ socialPngName } ` ;
8183 expect ( rootMetadata . openGraph ?. images ) . toEqual ( [
8284 {
8385 url : socialUrl ,
@@ -100,9 +102,9 @@ describe("public-site contract", () => {
100102
101103 const publicDirectory = join ( process . cwd ( ) , "public" ) ;
102104 const [ socialPng , socialSvg , qrCardPng , qrCardSvg ] = await Promise . all ( [
103- readFile ( join ( publicDirectory , "social" , "pyble-beta-og-1200x630.png" ) ) ,
105+ readFile ( join ( publicDirectory , "social" , socialPngName ) ) ,
104106 readFile (
105- join ( publicDirectory , "social" , "pyble-beta-og-1200x630.svg" ) ,
107+ join ( publicDirectory , "social" , socialSvgName ) ,
106108 "utf8" ,
107109 ) ,
108110 readFile ( join ( publicDirectory , "social" , "pyble-testflight-qr-1080.png" ) ) ,
@@ -118,9 +120,20 @@ describe("public-site contract", () => {
118120 expect ( socialSvg ) . toContain ( "Everyday coding over BLE." ) ;
119121 expect ( socialSvg ) . toContain ( "FIRMWARE HIL PENDING" ) ;
120122 expect ( socialSvg ) . not . toContain ( "WEB FLASHER" ) ;
121- expect ( createHash ( "sha256" ) . update ( socialPng ) . digest ( "hex" ) ) . toBe (
123+ const socialPngSha256 = createHash ( "sha256" )
124+ . update ( socialPng )
125+ . digest ( "hex" ) ;
126+ const socialSvgSha256 = createHash ( "sha256" )
127+ . update ( socialSvg )
128+ . digest ( "hex" ) ;
129+ expect ( socialPngSha256 ) . toBe (
122130 "7e7e037d9bd2e58e2e66f516bfd6f1b753bda472c402b8130f8a8a6dd8f19ba9" ,
123131 ) ;
132+ expect ( socialSvgSha256 ) . toBe (
133+ "48d458bd5a6ee1e754bad7d7f9a7261361c0d8a3b13c4fc9cc8a9f5670e04b5d" ,
134+ ) ;
135+ expect ( socialPngName ) . toContain ( socialPngSha256 . slice ( 0 , 8 ) ) ;
136+ expect ( socialSvgName ) . toContain ( socialSvgSha256 . slice ( 0 , 8 ) ) ;
124137 expect ( [ qrCardPng . readUInt32BE ( 16 ) , qrCardPng . readUInt32BE ( 20 ) ] ) . toEqual ( [
125138 1080 , 1080 ,
126139 ] ) ;
0 commit comments