You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					50 lines
				
				1.8 KiB
			
		
		
			
		
	
	
					50 lines
				
				1.8 KiB
			| 
											3 years ago
										 | import sinon from 'sinon' | ||
|  | import ViewHelpers from '../../../src/backend/utils/view-helpers/view-helpers' | ||
|  | 
 | ||
|  | const expectedResult = { | ||
|  |   recordActionUrl: '#recordActionUrl', | ||
|  |   resourceActionUrl: '#resourceActionUrl', | ||
|  |   bulkActionUrl: '#bulkActionUrl', | ||
|  |   loginUrl: 'loginUrl', | ||
|  |   logoutUrl: 'logoutUrl', | ||
|  |   rootUrl: 'admin', | ||
|  |   assetPath: 'assetPath', | ||
|  |   resourceUrl: 'resourceUrl', | ||
|  |   dashboardUrl: 'dashboardUrl', | ||
|  |   pageUrl: 'pageUrl', | ||
|  |   editUrl: 'editUrl', | ||
|  |   showUrl: 'showUrl', | ||
|  |   deleteUrl: 'deleteUrl', | ||
|  |   newUrl: 'newUrl', | ||
|  |   listUrl: 'listUrl', | ||
|  |   bulkDeleteUrl: 'bulkDeleteUrl', | ||
|  | } | ||
|  | 
 | ||
|  | export default (): ViewHelpers => ( | ||
|  |   { | ||
|  |     options: { | ||
|  |       loginPath: expectedResult.loginUrl, | ||
|  |       logoutPath: expectedResult.logoutUrl, | ||
|  |       rootPath: expectedResult.rootUrl, | ||
|  |     }, | ||
|  |     recordActionUrl: sinon.stub().returns(expectedResult.recordActionUrl), | ||
|  |     resourceActionUrl: sinon.stub().returns(expectedResult.resourceActionUrl), | ||
|  |     bulkActionUrl: sinon.stub().returns(expectedResult.bulkActionUrl), | ||
|  |     urlBuilder: sinon.stub(), | ||
|  |     loginUrl: sinon.stub().returns(expectedResult.loginUrl), | ||
|  |     logoutUrl: sinon.stub().returns(expectedResult.logoutUrl), | ||
|  |     assetPath: sinon.stub().returns(expectedResult.assetPath), | ||
|  |     resourceUrl: sinon.stub().returns(expectedResult.resourceUrl), | ||
|  |     dashboardUrl: sinon.stub().returns(expectedResult.dashboardUrl), | ||
|  |     pageUrl: sinon.stub().returns(expectedResult.pageUrl), | ||
|  |     editUrl: sinon.stub().returns(expectedResult.editUrl), | ||
|  |     showUrl: sinon.stub().returns(expectedResult.showUrl), | ||
|  |     deleteUrl: sinon.stub().returns(expectedResult.deleteUrl), | ||
|  |     newUrl: sinon.stub().returns(expectedResult.newUrl), | ||
|  |     listUrl: sinon.stub().returns(expectedResult.listUrl), | ||
|  |     bulkDeleteUrl: sinon.stub().returns(expectedResult.bulkDeleteUrl), | ||
|  |   } | ||
|  | ) | ||
|  | 
 | ||
|  | module.exports.expectedResult = expectedResult |