@@ -10,6 +10,7 @@ import { render, screen, within } from "@testing-library/react";
1010import { describe , expect , it , vi } from "vitest" ;
1111
1212import AppPage , { metadata as appMetadata } from "@/app/app/page" ;
13+ import SetupPage from "@/app/learn/setup/page" ;
1314import FlashPage , { metadata as flashMetadata } from "@/app/flash/page" ;
1415import { metadata as rootMetadata } from "@/app/layout" ;
1516import HomePage , { metadata as homeMetadata } from "@/app/page" ;
@@ -135,6 +136,32 @@ function jpegDimensions(bytes: Buffer): { width: number; height: number } {
135136}
136137
137138describe ( "public-site contract" , ( ) => {
139+ it . each ( [
140+ [ "home" , HomePage ] ,
141+ [ "app" , AppPage ] ,
142+ [ "setup" , SetupPage ] ,
143+ ] ) (
144+ "keeps %s installation copy consistent with public Android open testing" ,
145+ ( _name , Page ) => {
146+ const { container } = render ( < Page /> ) ;
147+ expect ( container ) . toHaveTextContent ( / G o o g l e P l a y o p e n t e s t i n g / i) ;
148+ expect ( container ) . not . toHaveTextContent (
149+ / i n v i t e d | i n v i t a t i o n .o n l y | i n t e r n a l t e s t | a p p r o v e d t e s t e r s | u n a p p r o v e d | n o t (?: a ) ? p u b l i c G o o g l e P l a y r e l e a s e / i,
150+ ) ;
151+ } ,
152+ ) ;
153+
154+ it ( "describes Android open testing in search and social metadata" , ( ) => {
155+ for ( const metadata of [ rootMetadata , homeMetadata , appMetadata ] ) {
156+ expect ( metadata . description ) . toMatch ( / G o o g l e P l a y o p e n t e s t i n g / i) ;
157+ expect ( JSON . stringify ( metadata ) ) . not . toMatch ( / i n v i t e d | i n t e r n a l t e s t / i) ;
158+ }
159+ for ( const metadata of [ rootMetadata , appMetadata ] ) {
160+ expect ( metadata . openGraph ?. description ) . toBe ( metadata . description ) ;
161+ expect ( metadata . twitter ?. description ) . toBe ( metadata . description ) ;
162+ }
163+ } ) ;
164+
138165 it ( "keeps pyble.dev canonical and presents Features and Learn in the primary routes" , ( ) => {
139166 expect ( siteConfig . origin ) . toBe ( "https://pyble.dev" ) ;
140167 expect ( siteConfig . alternateOrigin ) . toBe ( "https://pyble.org" ) ;
@@ -148,7 +175,7 @@ describe("public-site contract", () => {
148175
149176 it ( "publishes canonical metadata and static discovery files" , async ( ) => {
150177 expect ( siteConfig . description ) . toBe (
151- "A free, open-source, tablet-first IDE for MicroPython boards with compatible Bluetooth Low Energy agent firmware ." ,
178+ "PyBLE is a free, open-source MicroPython IDE over Bluetooth Low Energy. Available on Google Play open testing for Android and TestFlight for iPad ." ,
152179 ) ;
153180 expect ( homeMetadata . title ) . toEqual ( {
154181 absolute : "PyBLE — Python over Bluetooth Low Energy" ,
@@ -159,7 +186,7 @@ describe("public-site contract", () => {
159186 } ) ;
160187 expect ( appMetadata . title ) . toBe ( "PyBLE for iPad and Android" ) ;
161188 expect ( appMetadata . description ) . toMatch (
162- / i p a d e x t e r n a l b e t a . * a n d r o i d i n t e r n a l t e s t / i,
189+ / g o o g l e p l a y o p e n t e s t i n g . * i p a d e x t e r n a l b e t a / i,
163190 ) ;
164191 expect ( privacyMetadata . alternates ) . toEqual ( {
165192 canonical : "https://pyble.dev/privacy" ,
@@ -240,7 +267,7 @@ describe("public-site contract", () => {
240267 expect ( manifest ) . toMatchObject ( {
241268 short_name : "PyBLE" ,
242269 description :
243- "A free, open-source, tablet-first IDE for MicroPython boards with compatible Bluetooth Low Energy agent firmware ." ,
270+ "PyBLE is a free, open-source MicroPython IDE over Bluetooth Low Energy. Available on Google Play open testing for Android and TestFlight for iPad ." ,
244271 start_url : "/" ,
245272 theme_color : "#081B35" ,
246273 } ) ;
@@ -404,7 +431,7 @@ describe("public-site contract", () => {
404431 screen . getByText ( "Python over Bluetooth Low Energy" ) ,
405432 ) . toBeInTheDocument ( ) ;
406433 expect (
407- screen . getByText ( "iPad external beta + Android internal test " ) ,
434+ screen . getByText ( "iPad external beta + Android open testing " ) ,
408435 ) . toBeInTheDocument ( ) ;
409436 expect (
410437 screen . getByRole ( "link" , {
@@ -556,22 +583,19 @@ describe("public-site contract", () => {
556583 ) ;
557584
558585 const androidSection = screen . getByRole ( "region" , {
559- name : "Join the PyBLE Android internal test ." ,
586+ name : "Get PyBLE on Google Play ." ,
560587 } ) ;
561588 expect ( channelGroup ) . toContainElement ( testFlightSection ) ;
562589 expect ( channelGroup ) . toContainElement ( androidSection ) ;
563590 expect ( testFlightSection . parentElement ) . toBe ( androidSection . parentElement ) ;
564591 expect ( testFlightSection . parentElement ) . toHaveClass ( "beta-channel-grid" ) ;
565592 expect ( testFlightSection . nextElementSibling ) . toBe ( androidSection ) ;
566- expect (
567- within ( androidSection ) . getByText ( / a p p r o v e d i n t e r n a l t e s t e r s / i) ,
568- ) . toBeInTheDocument ( ) ;
569- expect (
570- within ( androidSection ) . getByText ( / n o t a p u b l i c G o o g l e P l a y r e l e a s e / i) ,
571- ) . toBeInTheDocument ( ) ;
572- expect (
573- within ( androidSection ) . getByText ( / u n a p p r o v e d .* m a y .* u n a v a i l a b l e / i) ,
574- ) . toBeInTheDocument ( ) ;
593+ expect ( androidSection ) . toHaveTextContent (
594+ / P y B L E 0 \. 2 \. 0 i s a v a i l a b l e o n G o o g l e P l a y o p e n t e s t i n g / i,
595+ ) ;
596+ expect ( androidSection ) . not . toHaveTextContent (
597+ / i n t e r n a l t e s t | i n v i t e d | a p p r o v e d t e s t e r s | n o t a p u b l i c G o o g l e P l a y r e l e a s e / i,
598+ ) ;
575599
576600 const testFlightLink = within ( testFlightSection ) . getByRole ( "link" , {
577601 name : "Open in TestFlight" ,
@@ -581,7 +605,7 @@ describe("public-site contract", () => {
581605 expect ( testFlightLink ) . toHaveAttribute ( "rel" , "noopener noreferrer" ) ;
582606
583607 const googlePlayLink = within ( androidSection ) . getByRole ( "link" , {
584- name : "Open Android internal test " ,
608+ name : "Get PyBLE on Google Play " ,
585609 } ) ;
586610 expect ( googlePlayLink ) . toHaveAttribute ( "href" , googlePlayUrl ) ;
587611 expect ( googlePlayLink ) . toHaveAttribute ( "target" , "_blank" ) ;
@@ -602,7 +626,7 @@ describe("public-site contract", () => {
602626 ) . toHaveAttribute ( "src" , "/testflight/pyble-testflight-qr.svg" ) ;
603627
604628 const googlePlayQrDescription =
605- "QR code for the PyBLE Android internal test on Google Play" ;
629+ "QR code for PyBLE on Google Play open testing " ;
606630 const googlePlayQrLink = within ( androidSection ) . getByRole ( "link" , {
607631 name : googlePlayQrDescription ,
608632 } ) ;
@@ -613,10 +637,7 @@ describe("public-site contract", () => {
613637 within ( androidSection ) . getByRole ( "img" , {
614638 name : googlePlayQrDescription ,
615639 } ) ,
616- ) . toHaveAttribute (
617- "src" ,
618- "/google-play/pyble-google-play-internal-test-qr.svg" ,
619- ) ;
640+ ) . toHaveAttribute ( "src" , "/google-play/pyble-google-play-qr.svg" ) ;
620641
621642 expect (
622643 within ( testFlightSection ) . getByText ( "testflight.apple.com/join/yU4e8s6d" ) ,
@@ -654,7 +675,7 @@ describe("public-site contract", () => {
654675 process . cwd ( ) ,
655676 "public" ,
656677 "google-play" ,
657- "pyble-google-play-internal-test- qr.svg" ,
678+ "pyble-google-play-qr.svg" ,
658679 ) ,
659680 sha256 :
660681 "fbd84d11d773346d0a2cd23f0e3193d02ff02e6c9780298294431d95dd07f32d" ,
@@ -684,7 +705,7 @@ describe("public-site contract", () => {
684705 expect ( siteConfig . testFlightUrl ) . toBe (
685706 "https://testflight.apple.com/join/yU4e8s6d" ,
686707 ) ;
687- expect ( siteConfig . googlePlayInternalTestUrl ) . toBe (
708+ expect ( siteConfig . googlePlayUrl ) . toBe (
688709 "https://play.google.com/store/apps/details?id=dev.pyble.pyble" ,
689710 ) ;
690711
@@ -696,12 +717,9 @@ describe("public-site contract", () => {
696717 expect ( testFlightLink ) . toHaveAttribute ( "rel" , "noopener noreferrer" ) ;
697718
698719 const googlePlayLink = screen . getByRole ( "link" , {
699- name : "Open Android internal test " ,
720+ name : "Get PyBLE on Google Play " ,
700721 } ) ;
701- expect ( googlePlayLink ) . toHaveAttribute (
702- "href" ,
703- siteConfig . googlePlayInternalTestUrl ,
704- ) ;
722+ expect ( googlePlayLink ) . toHaveAttribute ( "href" , siteConfig . googlePlayUrl ) ;
705723 expect ( googlePlayLink ) . toHaveAttribute ( "target" , "_blank" ) ;
706724 expect ( googlePlayLink ) . toHaveAttribute ( "rel" , "noopener noreferrer" ) ;
707725
@@ -717,23 +735,18 @@ describe("public-site contract", () => {
717735 ) . toBeInTheDocument ( ) ;
718736 expect (
719737 screen . getByRole ( "img" , {
720- name : "QR code for the PyBLE Android internal test on Google Play" ,
738+ name : "QR code for PyBLE on Google Play open testing " ,
721739 } ) ,
722- ) . toHaveAttribute (
723- "src" ,
724- "/google-play/pyble-google-play-internal-test-qr.svg" ,
725- ) ;
740+ ) . toHaveAttribute ( "src" , "/google-play/pyble-google-play-qr.svg" ) ;
726741 expect (
727- screen . getByText ( siteConfig . googlePlayInternalTestUrl , {
742+ screen . getByText ( siteConfig . googlePlayUrl , {
728743 selector : ".app-install__direct span" ,
729744 } ) ,
730745 ) . toBeInTheDocument ( ) ;
731- expect ( screen . getByText ( / a p p r o v e d i n t e r n a l t e s t e r s / i) ) . toBeInTheDocument ( ) ;
732- expect (
733- screen . getByText ( / n o t a p u b l i c G o o g l e P l a y r e l e a s e / i) ,
734- ) . toBeInTheDocument ( ) ;
735746 expect (
736- screen . getByText ( / u n a p p r o v e d .* m a y .* u n a v a i l a b l e / i) ,
747+ screen . getByText (
748+ / P y B L E 0 \. 2 \. 0 i s a v a i l a b l e o n G o o g l e P l a y o p e n t e s t i n g / i,
749+ ) ,
737750 ) . toBeInTheDocument ( ) ;
738751 expect (
739752 screen . getByRole ( "link" , { name : / o p e n f i r m w a r e i n s t a l l e r / i } ) ,
0 commit comments