mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-10-31 15:57:30 +03:00 
			
		
		
		
	Add extra testcase to base.dereference test suite
This commit is contained in:
		
							parent
							
								
									b67c3e8d50
								
							
						
					
					
						commit
						0c6ded776a
					
				|  | @ -84,9 +84,29 @@ describe('BaseComponent', () => { | |||
| 
 | ||||
|       it('should resolve nested schema', () => { | ||||
|         expect(paramWithRef.properties.subschema.$ref).to.not.exist; | ||||
|         paramWithRef._pointer.should.be.equal('#/definitions/Nested'); | ||||
|         paramWithRef.properties.subschema._pointer.should.be.equal('#/definitions/Simple'); | ||||
|         paramWithRef.properties.subschema.type.should.be.equal('object'); | ||||
|       }); | ||||
|     }); | ||||
| 
 | ||||
|     describe('array schema dereference', () => { | ||||
|       let paramWithRef; | ||||
|       before(() => { | ||||
|         component.pointer = '/paths/test3/get'; | ||||
|         component.onInit(); | ||||
|         component.dereference(); | ||||
|         paramWithRef = component.componentSchema.parameters[0]; | ||||
|       }); | ||||
| 
 | ||||
|       it('should resolve array schema', () => { | ||||
|         expect(paramWithRef.$ref).to.not.exist; | ||||
|         expect(paramWithRef.items.schema.$ref).to.not.exist; | ||||
|         paramWithRef.type.should.be.equal('array'); | ||||
|         paramWithRef._pointer.should.be.equal('#/definitions/ArrayOfSimple'); | ||||
|         paramWithRef.items.schema._pointer.should.be.equal('#/definitions/Simple'); | ||||
|         paramWithRef.items.schema.type.should.be.equal('object'); | ||||
|       }); | ||||
|     }); | ||||
|   }); | ||||
| }); | ||||
|  |  | |||
|  | @ -53,6 +53,16 @@ | |||
|           } | ||||
|         ] | ||||
|       } | ||||
|     }, | ||||
|     "test3": { | ||||
|       "get": { | ||||
|         "summary": "test get", | ||||
|         "parameters": [ | ||||
|           { | ||||
|             "$ref": "#/definitions/ArrayOfSimple" | ||||
|           } | ||||
|         ] | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user