2018-03-08 12:47:55 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								const { expect } = require('chai');
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-01-01 11:38:22 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const { mark } = require('./translator');
							 | 
						
					
						
							
								
									
										
										
										
											2018-03-08 12:47:55 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								describe('translator', () => {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  it('mark translation results and origins', () => {
							 | 
						
					
						
							
								
									
										
										
										
											2019-01-01 11:38:22 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    expect(mark(`<h2 class="no-toc" id="one-or-two">One or two</h2>
							 | 
						
					
						
							
								
									
										
										
										
											2018-03-08 12:47:55 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								<h2 class="no-toc" id="一或二">一或二</h2>`))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      .eql(`<h2 translation-origin="off"  class="no-toc" id="one-or-two">One or two</h2>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								<h2 translation-result  class="no-toc" id="一或二">一或二</h2>`);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  });
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								});
							 |