mirror of
				https://github.com/HabitRPG/habitica.git
				synced 2025-10-30 20:52:29 +01:00 
			
		
		
		
	* feat(api-v4): new /faq route added * refactor(server): change of function name in libs/content.js
		
			
				
	
	
		
			23 lines
		
	
	
		
			961 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			961 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import faq from '../../../../website/common/script/content/faq';
 | |
| import common from '../../../../website/common';
 | |
| import { localizeContentData } from '../../../../website/server/libs/content';
 | |
| 
 | |
| const { i18n } = common;
 | |
| 
 | |
| describe('localizeContentData', () => {
 | |
|   it('Should take a an object with localization identifiers and '
 | |
|     + 'return an object with actual translations in English', () => {
 | |
|     const faqInEnglish = localizeContentData(faq, 'en');
 | |
| 
 | |
|     expect(faqInEnglish).to.have.property('stillNeedHelp');
 | |
|     expect(faqInEnglish.stillNeedHelp.ios).to.equal(i18n.t('iosFaqStillNeedHelp', 'en'));
 | |
|   });
 | |
|   it('Should take an object with localization identifiers and '
 | |
|     + 'return an object with actual translations in German', () => {
 | |
|     const faqInEnglish = localizeContentData(faq, 'de');
 | |
| 
 | |
|     expect(faqInEnglish).to.have.property('stillNeedHelp');
 | |
|     expect(faqInEnglish.stillNeedHelp.ios).to.equal(i18n.t('iosFaqStillNeedHelp', 'de'));
 | |
|   });
 | |
| });
 |