@@ -22,7 +22,7 @@ context("Recordings", function () {
2222 describe ( "On the definition page" , ( ) => {
2323 beforeEach ( ( ) => {
2424 // Intercept calls to our API
25- cy . intercept ( "https://speech-db.altlab.app/maskwacis/api/bulk_search?*" , {
25+ cy . intercept ( "https://speech-db.altlab.app/maskwacis/api/bulk_search?*q=w%C3%A2pam%C3%AAw* " , {
2626 fixture : "recording/bulk_search/wâpamêw.json" ,
2727 } ) . as ( "recordingsResults" ) ;
2828 } ) ;
@@ -81,6 +81,21 @@ context("Recordings", function () {
8181 // clicking the link should open a new tab
8282 . should ( "have.attr" , "target" , "_blank" ) ;
8383 } ) ;
84+
85+ it ( "should display and play recordings inside the paradigm" , function ( ) {
86+ // Get to the definition/paradigm page for "wâpamêw"
87+ cy . setCookie ( "paradigm_audio" , "yes" ) ;
88+ cy . visitLemma ( "wâpamêw" ) ;
89+ cy . wait ( "@recordingsResults" ) ;
90+
91+ // And we should be able to click it.
92+ cy . get ( "div[data-cy=play-paradigm-recording][data-inflection=wâpamêw]" ) . click ( ) ;
93+
94+ // Note: figuring out if the audio actually played is... involved,
95+ // and error-prone, so it is not tested.
96+ // If you *want* to mock the Audio constructor... I mean, you can...
97+ // https://github.com/cypress-io/cypress/issues/1750#issuecomment-390751415
98+ } ) ;
8499 } ) ;
85100
86101 describe ( "When there are no recordings available" , ( ) => {
0 commit comments