@@ -130,7 +130,7 @@ const mockSearchResponse: SearchResponse = {
130130 {
131131 prescriptionId : "RX003" ,
132132 isDeleted : false ,
133- statusCode : PrescriptionStatus . WITH_DISPENSER_ACTIVE ,
133+ statusCode : PrescriptionStatus . AWAITING_RELEASE_READY ,
134134 issueDate : "2025-03-10" ,
135135 prescriptionTreatmentType : TreatmentType . ERD ,
136136 issueNumber : 3 ,
@@ -143,7 +143,7 @@ const mockSearchResponse: SearchResponse = {
143143 {
144144 prescriptionId : "RX004" ,
145145 isDeleted : false ,
146- statusCode : PrescriptionStatus . DISPENSED ,
146+ statusCode : PrescriptionStatus . NOT_DISPENSED ,
147147 issueDate : "2025-01-15" ,
148148 prescriptionTreatmentType : TreatmentType . REPEAT ,
149149 issueNumber : 1 ,
@@ -154,7 +154,7 @@ const mockSearchResponse: SearchResponse = {
154154 {
155155 prescriptionId : "RX005" ,
156156 isDeleted : false ,
157- statusCode : PrescriptionStatus . NOT_DISPENSED ,
157+ statusCode :PrescriptionStatus . CLAIMED ,
158158 issueDate : "2024-12-20" ,
159159 prescriptionTreatmentType : TreatmentType . ACUTE ,
160160 issueNumber : 1 ,
@@ -648,4 +648,61 @@ describe("PrescriptionListPage", () => {
648648 expect ( heading ) . toHaveTextContent ( "Sorry, there is a problem with this service" )
649649 } )
650650 } )
651+ it ( "renders correct message for a current prescription" , async ( ) => {
652+ mockedAxios . get . mockResolvedValue ( {
653+ status : 200 ,
654+ data : mockSearchResponse
655+ } )
656+
657+ renderWithRouter (
658+ FRONTEND_PATHS . PRESCRIPTION_LIST_CURRENT ,
659+ signedInAuthState ,
660+ {
661+ ...defaultSearchState ,
662+ prescriptionId : "C0C757-A83008-C2D93O"
663+ }
664+ )
665+ expect ( mockedAxios . get ) . toHaveBeenCalledTimes ( 1 )
666+
667+ const statusLabel = await screen . findByText ( "Available to download when due" )
668+ expect ( statusLabel ) . toBeInTheDocument ( )
669+ } )
670+ it ( "renders correct message for a past prescription" , async ( ) => {
671+ mockedAxios . get . mockResolvedValue ( {
672+ status : 200 ,
673+ data : mockSearchResponse
674+ } )
675+
676+ renderWithRouter (
677+ FRONTEND_PATHS . PRESCRIPTION_LIST_PAST ,
678+ signedInAuthState ,
679+ {
680+ ...defaultSearchState ,
681+ prescriptionId : "C0C757-A83008-C2D93O"
682+ }
683+ )
684+ expect ( mockedAxios . get ) . toHaveBeenCalledTimes ( 1 )
685+
686+ const statusLabel = await screen . findByText ( "Not dispensed" )
687+ expect ( statusLabel ) . toBeInTheDocument ( )
688+ } )
689+ it ( "renders correct message for a future prescription" , async ( ) => {
690+ mockedAxios . get . mockResolvedValue ( {
691+ status : 200 ,
692+ data : mockSearchResponse
693+ } )
694+
695+ renderWithRouter (
696+ FRONTEND_PATHS . PRESCRIPTION_LIST_FUTURE ,
697+ signedInAuthState ,
698+ {
699+ ...defaultSearchState ,
700+ prescriptionId : "C0C757-A83008-C2D93O"
701+ }
702+ )
703+ expect ( mockedAxios . get ) . toHaveBeenCalledTimes ( 1 )
704+
705+ const statusLabel = await screen . findByText ( "To dispense in the future" )
706+ expect ( statusLabel ) . toBeInTheDocument ( )
707+ } )
651708} )
0 commit comments