@@ -209,7 +209,8 @@ define(function (require, exports, module) {
209209 liveDoc = LiveDevMultiBrowser . getCurrentLiveDoc ( ) ;
210210 await awaitsFor (
211211 function relatedDocsReceived ( ) {
212- return ( Object . getOwnPropertyNames ( liveDoc . getRelated ( ) . scripts ) . length > 0 ) ;
212+ return ( Object . getOwnPropertyNames ( liveDoc . getRelated ( ) . scripts ) . length > 0 ) &&
213+ liveDoc . isRelated ( testFolder + "/import1.css" ) ;
213214 } ,
214215 "relatedDocuments.done.received" ,
215216 10000
@@ -236,6 +237,28 @@ define(function (require, exports, module) {
236237 await endPreviewSession ( ) ;
237238 } , 30000 ) ;
238239
240+ it ( "should render partial arabic html with correct utf-8 encoding" , async function ( ) {
241+ // https://github.com/orgs/phcode-dev/discussions/1676
242+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "arabicPartial.html" ] ) ,
243+ "SpecRunnerUtils.openProjectFiles arabicPartial.html" ) ;
244+ await waitsForLiveDevelopmentToOpen ( ) ;
245+
246+ let result ;
247+ await awaitsFor (
248+ function isArabicTextProperlyRendered ( ) {
249+ LiveDevProtocol . evaluate ( `document.getElementById('arabic-text').textContent` )
250+ . done ( ( response ) => {
251+ result = JSON . parse ( response . result || "" ) ;
252+ } ) ;
253+ return result === " 1 يناير 2021 بواسطة " ;
254+ } ,
255+ `arabic text to be read correctly` ,
256+ 5000 ,
257+ 50
258+ ) ;
259+ await endPreviewSession ( ) ;
260+ } , 30000 ) ;
261+
239262 function _isRelatedStyleSheet ( liveDoc , fileName ) {
240263 let relatedSheets = Object . keys ( liveDoc . getRelated ( ) . stylesheets ) ;
241264 for ( let relatedPath of relatedSheets ) {
@@ -371,7 +394,7 @@ define(function (require, exports, module) {
371394 } ) ;
372395 return result === verifyText ;
373396 } ,
374- " relatedDocuments.done.received" ,
397+ ` relatedDocuments.done.received verifying ${ verifyID } to have ${ verifyText } ` ,
375398 5000 ,
376399 50
377400 ) ;
0 commit comments