@@ -199,6 +199,50 @@ describe("OpenAPI 3.1 Request Body upload file button", () => {
199199 } )
200200 } )
201201
202+ describe ( "schema contentMediaType is a non-empty string" , ( ) => {
203+ beforeEach ( ( ) => {
204+ cy . get ( "#operations-default-uploadSchemaContentMediaType" ) . click ( )
205+ } )
206+
207+ it ( "should display description with the correct content type" , ( ) => {
208+ cy . get (
209+ ".opblock-section-request-body .opblock-description-wrapper i"
210+ ) . should (
211+ "have.text" ,
212+ "Example values are not available for application/x-custom media types."
213+ )
214+ } )
215+
216+ it ( "should display a file upload button" , ( ) => {
217+ cy . get ( ".try-out__btn" ) . click ( )
218+ cy . get (
219+ ".opblock-section-request-body .opblock-description-wrapper input"
220+ ) . should ( "have.prop" , "type" , "file" )
221+ } )
222+ } )
223+
224+ describe ( "schema contentEncoding is a non-empty string" , ( ) => {
225+ beforeEach ( ( ) => {
226+ cy . get ( "#operations-default-uploadSchemaContentEncoding" ) . click ( )
227+ } )
228+
229+ it ( "should display description with the correct content type" , ( ) => {
230+ cy . get (
231+ ".opblock-section-request-body .opblock-description-wrapper i"
232+ ) . should (
233+ "have.text" ,
234+ "Example values are not available for application/x-custom media types."
235+ )
236+ } )
237+
238+ it ( "should display a file upload button" , ( ) => {
239+ cy . get ( ".try-out__btn" ) . click ( )
240+ cy . get (
241+ ".opblock-section-request-body .opblock-description-wrapper input"
242+ ) . should ( "have.prop" , "type" , "file" )
243+ } )
244+ } )
245+
202246 describe ( "multipart/form-data object property with schema type string and format binary" , ( ) => {
203247 beforeEach ( ( ) => {
204248 cy . get ( "#operations-default-uploadPropertySchemaFormatBinary" ) . click ( )
@@ -254,4 +298,30 @@ describe("OpenAPI 3.1 Request Body upload file button", () => {
254298 ) . should ( "have.prop" , "type" , "file" )
255299 } )
256300 } )
301+
302+ describe ( "multipart/form-data object property schema has contentMediaType with non-empty string" , ( ) => {
303+ beforeEach ( ( ) => {
304+ cy . get ( "#operations-default-uploadPropertySchemaContentMediaType" ) . click ( )
305+ } )
306+
307+ it ( "should display a file upload button" , ( ) => {
308+ cy . get ( ".try-out__btn" ) . click ( )
309+ cy . get (
310+ ".opblock-section-request-body .opblock-description-wrapper input"
311+ ) . should ( "have.prop" , "type" , "file" )
312+ } )
313+ } )
314+
315+ describe ( "multipart/form-data object property schema has contentEncoding with non-empty string" , ( ) => {
316+ beforeEach ( ( ) => {
317+ cy . get ( "#operations-default-uploadPropertySchemaContentEncoding" ) . click ( )
318+ } )
319+
320+ it ( "should display a file upload button" , ( ) => {
321+ cy . get ( ".try-out__btn" ) . click ( )
322+ cy . get (
323+ ".opblock-section-request-body .opblock-description-wrapper input"
324+ ) . should ( "have.prop" , "type" , "file" )
325+ } )
326+ } )
257327} )
0 commit comments