@@ -234,7 +234,7 @@ const mockSearchResponse: SearchResponse = {
234234 {
235235 prescriptionId : "RX003" ,
236236 isDeleted : false ,
237- statusCode : PrescriptionStatus . WITH_DISPENSER_ACTIVE ,
237+ statusCode : PrescriptionStatus . AWAITING_RELEASE_READY ,
238238 issueDate : "2025-03-10" ,
239239 prescriptionTreatmentType : TreatmentType . ERD ,
240240 issueNumber : 3 ,
@@ -247,7 +247,7 @@ const mockSearchResponse: SearchResponse = {
247247 {
248248 prescriptionId : "RX004" ,
249249 isDeleted : false ,
250- statusCode : PrescriptionStatus . DISPENSED ,
250+ statusCode : PrescriptionStatus . NOT_DISPENSED ,
251251 issueDate : "2025-01-15" ,
252252 prescriptionTreatmentType : TreatmentType . REPEAT ,
253253 issueNumber : 1 ,
@@ -258,7 +258,7 @@ const mockSearchResponse: SearchResponse = {
258258 {
259259 prescriptionId : "RX005" ,
260260 isDeleted : false ,
261- statusCode : PrescriptionStatus . NOT_DISPENSED ,
261+ statusCode :PrescriptionStatus . CLAIMED ,
262262 issueDate : "2024-12-20" ,
263263 prescriptionTreatmentType : TreatmentType . ACUTE ,
264264 issueNumber : 1 ,
@@ -835,4 +835,61 @@ describe("PrescriptionListPage", () => {
835835 expect ( heading ) . toHaveTextContent ( "Sorry, there is a problem with this service" )
836836 } )
837837 } )
838+ it ( "renders correct message for a current prescription" , async ( ) => {
839+ mockedAxios . get . mockResolvedValue ( {
840+ status : 200 ,
841+ data : mockSearchResponse
842+ } )
843+
844+ renderWithRouter (
845+ FRONTEND_PATHS . PRESCRIPTION_LIST_CURRENT ,
846+ signedInAuthState ,
847+ {
848+ ...defaultSearchState ,
849+ prescriptionId : "C0C757-A83008-C2D93O"
850+ }
851+ )
852+ expect ( mockedAxios . get ) . toHaveBeenCalledTimes ( 1 )
853+
854+ const statusLabel = await screen . findByText ( "Available to download when due" )
855+ expect ( statusLabel ) . toBeInTheDocument ( )
856+ } )
857+ it ( "renders correct message for a past prescription" , async ( ) => {
858+ mockedAxios . get . mockResolvedValue ( {
859+ status : 200 ,
860+ data : mockSearchResponse
861+ } )
862+
863+ renderWithRouter (
864+ FRONTEND_PATHS . PRESCRIPTION_LIST_PAST ,
865+ signedInAuthState ,
866+ {
867+ ...defaultSearchState ,
868+ prescriptionId : "C0C757-A83008-C2D93O"
869+ }
870+ )
871+ expect ( mockedAxios . get ) . toHaveBeenCalledTimes ( 1 )
872+
873+ const statusLabel = await screen . findByText ( "Not dispensed" )
874+ expect ( statusLabel ) . toBeInTheDocument ( )
875+ } )
876+ it ( "renders correct message for a future prescription" , async ( ) => {
877+ mockedAxios . get . mockResolvedValue ( {
878+ status : 200 ,
879+ data : mockSearchResponse
880+ } )
881+
882+ renderWithRouter (
883+ FRONTEND_PATHS . PRESCRIPTION_LIST_FUTURE ,
884+ signedInAuthState ,
885+ {
886+ ...defaultSearchState ,
887+ prescriptionId : "C0C757-A83008-C2D93O"
888+ }
889+ )
890+ expect ( mockedAxios . get ) . toHaveBeenCalledTimes ( 1 )
891+
892+ const statusLabel = await screen . findByText ( "To dispense in the future" )
893+ expect ( statusLabel ) . toBeInTheDocument ( )
894+ } )
838895} )
0 commit comments