diff --git a/arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/TestAbility/pages/richeditor.ets b/arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/TestAbility/pages/richeditor.ets index e0e0b88c40c074e3e7e35d0d07de9429985b3cca..288c1391251cfb80c1dfb21014a90dab966d0e43 100644 --- a/arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/TestAbility/pages/richeditor.ets +++ b/arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/TestAbility/pages/richeditor.ets @@ -15,11 +15,15 @@ @Entry @Component struct RichEditorExample { + @State spanStart: number = -1; + @State spanEnd: number = -1; + @State spanNum: number = -1; @State text1: string = ''; @State text2: string = ''; @State current: number = 5 @State Richdelete: Boolean = false; controller1:RichEditorController = new RichEditorController(); + RichEditorInsertValue: RichEditorInsertValue = { insertOffset:10, insertValue:"aaaaaa" } controller: RichEditorController = new RichEditorController() build() { Column() { @@ -109,24 +113,60 @@ struct RichEditorExample { Column() { RichEditor({ controller: this.controller }) + .key('Stage_RichEditor_Test_2100') + .key('Stage_RichEditor_Test_2200') .aboutToIMEInput((RichEditorInsertValue) => { + let InsertValue: RichEditorInsertValue = { insertOffset:10, insertValue:"aaaaaa" } + InsertValue.insertValue.toString() + RichEditorInsertValue.insertValue.toString() + InsertValue.insertOffset.toString() + RichEditorInsertValue.insertOffset.toString() console.log("wxh test app aboutToIMEInput") return true }) + .key('Stage_RichEditor_Test_2300') .onIMEInputComplete((RichEditorTextSpanResult) => { + let TextSpanResult: RichEditorTextSpanResult = { spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",textStyle:(null),offsetInSpan:[10,100]} + let SpanPosition: RichEditorSpanPosition = { spanIndex:20, spanRange:[20,20]} + SpanPosition.spanRange.toString() + SpanPosition.spanIndex.toString() + TextSpanResult.spanPosition.toString() + RichEditorTextSpanResult.spanPosition.toString() + TextSpanResult.offsetInSpan.toString() + RichEditorTextSpanResult.offsetInSpan.toString() console.log("wxh test app onIMEInputComplete") + return ({ spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",textStyle:(null),offsetInSpan:[10,100]}) }) + .key('Stage_RichEditor_Test_2400') .aboutToDelete((RichEditorDeleteValue) => { + let DeleteValue: RichEditorDeleteValue = { offset:10,direction:(RichEditorDeleteDirection.BACKWARD),length:10,richEditorDeleteSpans:(null)} + let DeleteValue1: RichEditorDeleteValue = { offset:10,direction:(RichEditorDeleteDirection.FORWARD),length:10,richEditorDeleteSpans:(null)} + DeleteValue.richEditorDeleteSpans.toString() + DeleteValue1.richEditorDeleteSpans.toString() + RichEditorDeleteValue.richEditorDeleteSpans.toString() console.log("wxh test app aboutToDelete") return true - }) + }).key('Stage_RichEditor_Test_2600') .onDeleteComplete(() => { let DeleteValue: RichEditorDeleteValue = { offset:10,direction:(RichEditorDeleteDirection.BACKWARD),length:10,richEditorDeleteSpans:(null)} let DeleteValue1: RichEditorDeleteValue = { offset:10,direction:(RichEditorDeleteDirection.FORWARD),length:10,richEditorDeleteSpans:(null)} + let ImageSpanResult: RichEditorImageSpanResult = { spanPosition:{ spanIndex:10, spanRange:[10,10]},valuePixelMap:(null),valueResourceStr:("aaa"),imageStyle:{ size:[10,10],verticalAlign:(ImageSpanAlignment.TOP),objectFit:(ImageFit.Auto)},offsetInSpan:[10,100]} + ImageSpanResult.offsetInSpan.toString() + ImageSpanResult.spanPosition.spanIndex.toString() + ImageSpanResult.spanPosition.spanRange.toString() + ImageSpanResult.valuePixelMap.isEditable.valueOf() + ImageSpanResult.valueResourceStr.toString() + ImageSpanResult.imageStyle.size.toString() + ImageSpanResult.imageStyle.verticalAlign.toString() + ImageSpanResult.imageStyle.objectFit.toString() this.Richdelete = true; console.log("wxh test app onDeleteComplete") - }).key('Stage_RichEditor_Test_2100') + }).key('Stage_RichEditor_Test_2700') .onReady(() => { + let TextSpan: RichEditorTextSpan = { spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",textStyle:{ }} + let ImageSpan: RichEditorImageSpan = { spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",imageStyle:{ size:[10,10],verticalAlign:(ImageSpanAlignment.CENTER),objectFit:(ImageFit.Contain)}} + TextSpan.spanPosition.spanRange.toString() + TextSpan.spanPosition.spanIndex.toString() for (let i = 0; i < 10; i++) { this.controller.addTextSpan("实例文字", { offset: 6, @@ -139,7 +179,6 @@ struct RichEditorExample { decoration: { type: TextDecorationType.Underline, color: Color.Red } } }) - this.controller.addImageSpan($r('app.media.icon'), { offset: 0, imageStyle: { @@ -148,6 +187,19 @@ struct RichEditorExample { }) } }) + .key('Stage_RichEditor_Test_2500') + .onSelect((value: RichEditorSelection) => { + let Selection: RichEditorSelection = { selection:[10,10],spans:(null)} + Selection.selection.toString() + Selection.spans.toString() + this.spanStart = value.selection[0] + this.spanEnd = value.selection[1] + this.spanNum = value.spans.length + console.log("mim_log: onSelect selection start: " + value.selection[0]) + console.log("mim_log: onSelect selection end: " + value.selection[1]) + console.log("mim_log: onSelect spans length: " + value.spans.length); + return { selection:[10,10],spans:(null)} + }) .borderWidth(1).borderColor(Color.Green) } diff --git a/arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/richeditor.test.ets b/arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/richeditor.test.ets index 50611f434658ef97e08486aa019d9e4b605491dc..f33f03cc7f42b1b6b7804e241dfa217336aa4e01 100644 --- a/arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/richeditor.test.ets +++ b/arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/richeditor.test.ets @@ -41,28 +41,28 @@ export default function ActsRichEditorTest() { // Defines a test suite. Two parameters are supported: test suite name and test suite function. it('Stage_RichEditor_Test_0100', 0, async function (done) { console.info('Stage_RichEditor_Test_0100 START'); - try{ - let controller = new RichEditorController() - let res = controller.addTextSpan("实例文字0", { - offset: 5, - style: { - fontColor: Color.Red, - fontSize: 8, - fontStyle: FontStyle.Italic, - fontWeight: FontWeight.Lighter, - fontFamily: "sans-serif", - decoration: { type: TextDecorationType.None, color: Color.Brown } - } - }) - console.info('Stage_Font_0100 START :'+ JSON.stringify(res)); - expect(typeof(res)).assertEqual('number') - expect(res).assertEqual(0) - console.info('Stage_RichEditor_Test_0100 END '); - } catch(err) { - expect().assertFail() - console.info('Stage_RichEditor_Test_0100 ERR '+ JSON.stringify(err)); - } - done(); + try{ + let controller = new RichEditorController() + let res = controller.addTextSpan("实例文字0", { + offset: 5, + style: { + fontColor: Color.Red, + fontSize: 8, + fontStyle: FontStyle.Italic, + fontWeight: FontWeight.Lighter, + fontFamily: "sans-serif", + decoration: { type: TextDecorationType.None, color: Color.Brown } + } + }) + console.info('Stage_Font_0100 START :'+ JSON.stringify(res)); + expect(typeof(res)).assertEqual('number') + expect(res).assertEqual(0) + console.info('Stage_RichEditor_Test_0100 END '); + } catch(err) { + expect().assertFail() + console.info('Stage_RichEditor_Test_0100 ERR '+ JSON.stringify(err)); + } + done(); }); it('Stage_RichEditor_Test_0200', 0, async function (done) { @@ -396,57 +396,196 @@ export default function ActsRichEditorTest() { it('Stage_RichEditor_Test_2100', 0, async function (done) { console.info('Stage_RichEditor_Test_2100 START'); + setTimeout(()=>{ + try{ + let RichEditorInsertValue: RichEditorInsertValue = { insertOffset:10, insertValue:"aaaaaa" } + let RichEditorSpanPosition: RichEditorSpanPosition = { spanIndex:10, spanRange:[10,10]} + let RichEditorTextSpan: RichEditorTextSpan = { spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",textStyle:{ }} + let RichEditorImageSpanStyle: RichEditorImageSpanStyle = { size:[10,10],verticalAlign:(ImageSpanAlignment.CENTER),objectFit:(ImageFit.Contain)} + let RichEditorTextSpanResult: RichEditorTextSpanResult = { spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",textStyle:(null),offsetInSpan:[10,100]} + let RichEditorImageSpanStyleResult: RichEditorImageSpanStyleResult = { size:[10,10],verticalAlign:(ImageSpanAlignment.BASELINE),objectFit:(ImageFit.Cover)} + let RichEditorImageSpanResult: RichEditorImageSpanResult = { spanPosition:{ spanIndex:10, spanRange:[10,10]},valuePixelMap:(null),valueResourceStr:("aaa"),imageStyle:{ size:[10,10],verticalAlign:(ImageSpanAlignment.TOP),objectFit:(ImageFit.Auto)},offsetInSpan:[10,100]} + let RichEditorImageSpan: RichEditorImageSpan = { spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",imageStyle:{ size:[10,10],verticalAlign:(ImageSpanAlignment.CENTER),objectFit:(ImageFit.Contain)}} + let RichEditorImageSpanOptions: RichEditorImageSpanOptions = { offset:10,imageStyle:{ size:[10,10],verticalAlign:(ImageSpanAlignment.CENTER),objectFit:(ImageFit.Contain)}} + let RichEditorUpdateImageSpanStyleOptions: RichEditorUpdateImageSpanStyleOptions = { imageStyle:{ size:[10,10],verticalAlign:(ImageSpanAlignment.CENTER),objectFit:(ImageFit.Contain)}} + let RichEditorSelection: RichEditorSelection = { selection:[10,10],spans:(null)} + let RichEditorDeleteValue: RichEditorDeleteValue = { offset:10,direction:(0),length:10,richEditorDeleteSpans:(null)} + let RichEditorDeleteValue1: RichEditorDeleteValue = { offset:10,direction:(1),length:10,richEditorDeleteSpans:(null)} + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorInsertValue)) + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorSpanPosition)) + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorTextSpan)) + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorImageSpanStyle)) + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorTextSpanResult)) + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorImageSpanStyleResult)) + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorImageSpanResult)) + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorImageSpan)) + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorImageSpanOptions)) + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorUpdateImageSpanStyleOptions)) + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorSelection)) + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorDeleteValue)) + console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(RichEditorDeleteValue1)) + expect(typeof RichEditorInsertValue).assertEqual("object") + expect(typeof RichEditorSpanPosition).assertEqual("object") + expect(typeof RichEditorTextSpan).assertEqual("object") + expect(typeof RichEditorImageSpanStyle).assertEqual("object") + expect(typeof RichEditorTextSpanResult).assertEqual("object") + expect(typeof RichEditorImageSpanStyleResult).assertEqual("object") + expect(typeof RichEditorImageSpanResult).assertEqual("object") + expect(typeof RichEditorImageSpan).assertEqual("object") + expect(typeof RichEditorImageSpanOptions).assertEqual("object") + expect(typeof RichEditorUpdateImageSpanStyleOptions).assertEqual("object") + expect(typeof RichEditorSelection).assertEqual("object") + expect(typeof RichEditorDeleteValue).assertEqual("object") + expect(typeof RichEditorDeleteValue1).assertEqual("object") + + console.info('Stage_RichEditor_Test_2100 END '); + } catch(err) { + expect().assertFail() + console.info('Stage_RichEditor_Test_2100 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + it('Stage_RichEditor_Test_2200', 0, async function (done) { + console.info('Stage_RichEditor_Test_2200 START'); + setTimeout(()=>{ + try{ + let RichEditorInsertValue: RichEditorInsertValue = { insertOffset:10, insertValue:"aaaaaa" } + console.info("Stage_RichEditor_Test_2200 InsertValue is: " + JSON.stringify(RichEditorInsertValue)) + expect(typeof RichEditorInsertValue).assertEqual("object") + expect(RichEditorInsertValue.insertOffset).assertEqual(10) + expect(RichEditorInsertValue.insertValue).assertEqual("aaaaaa") + + console.info('Stage_RichEditor_Test_2200 END '); + } catch(err) { + expect().assertFail() + console.info('Stage_RichEditor_Test_2200 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + it('Stage_RichEditor_Test_2300', 0, async function (done) { + console.info('Stage_RichEditor_Test_2300 START'); + setTimeout(()=>{ + try{ + let RichEditorTextSpanResult: RichEditorTextSpanResult = { spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",textStyle:(null),offsetInSpan:[10,100]} + let RichEditorSpanPosition: RichEditorSpanPosition = { spanIndex:20, spanRange:[20,20]} + console.info("Stage_RichEditor_Test_2300 InsertValue is: " + JSON.stringify(RichEditorTextSpanResult)) + console.info("Stage_RichEditor_Test_2300 InsertValue is: " + JSON.stringify(RichEditorSpanPosition)) + expect(typeof RichEditorTextSpanResult).assertEqual("object") + expect(typeof RichEditorSpanPosition).assertEqual("object") + expect(RichEditorTextSpanResult.spanPosition.spanIndex).assertEqual(10) + expect(RichEditorTextSpanResult.spanPosition.spanRange[0]).assertEqual(10) + expect(RichEditorTextSpanResult.spanPosition.spanRange[1]).assertEqual(10) + expect(RichEditorSpanPosition.spanIndex).assertEqual(20) + expect(RichEditorSpanPosition.spanRange[0]).assertEqual(20) + expect(RichEditorSpanPosition.spanRange[1]).assertEqual(20) + expect(RichEditorTextSpanResult.offsetInSpan[0]).assertEqual(10) + expect(RichEditorTextSpanResult.offsetInSpan[1]).assertEqual(100) + + console.info('Stage_RichEditor_Test_2300 END '); + } catch(err) { + expect().assertFail() + console.info('Stage_RichEditor_Test_2300 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + it('Stage_RichEditor_Test_2400', 0, async function (done) { + console.info('Stage_RichEditor_Test_2400 START'); + setTimeout(()=>{ + try{ + let RichEditorDeleteValue: RichEditorDeleteValue = { offset:10,direction:(0),length:10,richEditorDeleteSpans:(null)} + let RichEditorDeleteValue1: RichEditorDeleteValue = { offset:10,direction:(1),length:10,richEditorDeleteSpans:(null)} + console.info("Stage_RichEditor_Test_2400 InsertValue is: " + JSON.stringify(RichEditorDeleteValue)) + console.info("Stage_RichEditor_Test_2400 InsertValue is: " + JSON.stringify(RichEditorDeleteValue1)) + expect(typeof RichEditorDeleteValue).assertEqual("object") + expect(typeof RichEditorDeleteValue1).assertEqual("object") + expect(RichEditorDeleteValue.richEditorDeleteSpans).assertEqual(null) + expect(RichEditorDeleteValue1.richEditorDeleteSpans).assertEqual(null) + + console.info('Stage_RichEditor_Test_2400 END '); + } catch(err) { + expect().assertFail() + console.info('Stage_RichEditor_Test_2400 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + it('Stage_RichEditor_Test_2500', 0, async function (done) { + console.info('Stage_RichEditor_Test_2500 START'); + setTimeout(()=>{ + try{ + let RichEditorSelection: RichEditorSelection = { selection:[10,10],spans:(null)} + console.info("Stage_RichEditor_Test_2500 InsertValue is: " + JSON.stringify(RichEditorSelection)) + expect(typeof RichEditorSelection).assertEqual("object") + expect(RichEditorSelection.selection[0]).assertEqual(10) + expect(RichEditorSelection.selection[1]).assertEqual(10) + expect(RichEditorSelection.spans).assertEqual(null) + console.info('Stage_RichEditor_Test_2500 END '); + } catch(err) { + expect().assertFail() + console.info('Stage_RichEditor_Test_2500 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + it('Stage_RichEditor_Test_2600', 0, async function (done) { + console.info('Stage_RichEditor_Test_2600 START'); setTimeout(()=>{ try{ - let InsertValue: RichEditorInsertValue = { insertOffset:10, insertValue:"aaaaaa" } - let SpanPosition: RichEditorSpanPosition = { spanIndex:10, spanRange:[10,10]} - let TextSpan: RichEditorTextSpan = { spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",textStyle:{ }} - let ImageSpanStyle: RichEditorImageSpanStyle = { size:[10,10],verticalAlign:(ImageSpanAlignment.CENTER),objectFit:(ImageFit.Contain)} - let TextSpanResult: RichEditorTextSpanResult = { spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",textStyle:(null),offsetInSpan:[10,100]} - let ImageSpanStyleResult: RichEditorImageSpanStyleResult = { size:[10,10],verticalAlign:(ImageSpanAlignment.BASELINE),objectFit:(ImageFit.Cover)} - let ImageSpanResult: RichEditorImageSpanResult = { spanPosition:{ spanIndex:10, spanRange:[10,10]},valuePixelMap:(null),valueResourceStr:("aaa"),imageStyle:{ size:[10,10],verticalAlign:(ImageSpanAlignment.TOP),objectFit:(ImageFit.Auto)},offsetInSpan:[10,100]} - let ImageSpan: RichEditorImageSpan = { spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",imageStyle:{ size:[10,10],verticalAlign:(ImageSpanAlignment.CENTER),objectFit:(ImageFit.Contain)}} - let ImageSpanOptions: RichEditorImageSpanOptions = { offset:10,imageStyle:{ size:[10,10],verticalAlign:(ImageSpanAlignment.CENTER),objectFit:(ImageFit.Contain)}} - let ImageSpanStyleOptions: RichEditorUpdateImageSpanStyleOptions = { imageStyle:{ size:[10,10],verticalAlign:(ImageSpanAlignment.CENTER),objectFit:(ImageFit.Contain)}} - let Selection: RichEditorSelection = { selection:[10,10],spans:(null)} - let DeleteValue: RichEditorDeleteValue = { offset:10,direction:(0),length:10,richEditorDeleteSpans:(null)} - let DeleteValue1: RichEditorDeleteValue = { offset:10,direction:(1),length:10,richEditorDeleteSpans:(null)} - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(InsertValue)) - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(SpanPosition)) - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(TextSpan)) - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(ImageSpanStyle)) - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(TextSpanResult)) - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(ImageSpanStyleResult)) - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(ImageSpanResult)) - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(ImageSpan)) - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(ImageSpanOptions)) - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(ImageSpanStyleOptions)) - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(Selection)) - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(DeleteValue)) - console.info("Stage_RichEditor_Test_2100 InsertValue is: " + JSON.stringify(DeleteValue1)) - expect(typeof InsertValue).assertEqual("object") - expect(typeof SpanPosition).assertEqual("object") - expect(typeof TextSpan).assertEqual("object") - expect(typeof ImageSpanStyle).assertEqual("object") - expect(typeof TextSpanResult).assertEqual("object") - expect(typeof ImageSpanStyleResult).assertEqual("object") - expect(typeof ImageSpanResult).assertEqual("object") - expect(typeof ImageSpan).assertEqual("object") - expect(typeof ImageSpanOptions).assertEqual("object") - expect(typeof ImageSpanStyleOptions).assertEqual("object") - expect(typeof Selection).assertEqual("object") - expect(typeof DeleteValue).assertEqual("object") - expect(typeof DeleteValue1).assertEqual("object") - - console.info('Stage_RichEditor_Test_2100 END '); + let RichEditorImageSpanResult: RichEditorImageSpanResult = { spanPosition:{ spanIndex:10, spanRange:[10,10]},valuePixelMap:(null),valueResourceStr:("aaa"),imageStyle:{ size:[10,10],verticalAlign:(ImageSpanAlignment.TOP),objectFit:(ImageFit.Auto)},offsetInSpan:[10,100]} + console.info("Stage_RichEditor_Test_2600 InsertValue is: " + JSON.stringify(RichEditorImageSpanResult)) + expect(typeof RichEditorImageSpanResult).assertEqual("object") + expect(RichEditorImageSpanResult.spanPosition.spanRange[0]).assertEqual(10) + expect(RichEditorImageSpanResult.spanPosition.spanRange[1]).assertEqual(10) + expect(RichEditorImageSpanResult.spanPosition.spanIndex).assertEqual(10) + expect(RichEditorImageSpanResult.valuePixelMap).assertEqual(null) + expect(RichEditorImageSpanResult.valueResourceStr).assertEqual("aaa") + expect(RichEditorImageSpanResult.imageStyle.size[0]).assertEqual(10) + expect(RichEditorImageSpanResult.imageStyle.size[1]).assertEqual(10) + expect(RichEditorImageSpanResult.imageStyle.verticalAlign).assertEqual(ImageSpanAlignment.TOP) + expect(RichEditorImageSpanResult.imageStyle.objectFit).assertEqual(ImageFit.Auto) + expect(RichEditorImageSpanResult.offsetInSpan[0]).assertEqual(10) + expect(RichEditorImageSpanResult.offsetInSpan[1]).assertEqual(100) + console.info('Stage_RichEditor_Test_2600 END '); } catch(err) { expect().assertFail() - console.info('Stage_RichEditor_Test_2100 ERR '+ JSON.stringify(err)); + console.info('Stage_RichEditor_Test_2600 ERR '+ JSON.stringify(err)); } done(); },500) }); + it('Stage_RichEditor_Test_2700', 0, async function (done) { + console.info('Stage_RichEditor_Test_2700 START'); + setTimeout(()=>{ + try{ + let RichEditorTextSpan: RichEditorTextSpan = { spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",textStyle:{ }} + let RichEditorImageSpan: RichEditorImageSpan = { spanPosition:{ spanIndex:10, spanRange:[10,10]},value:"aaaaa",imageStyle:{ size:[10,10],verticalAlign:(ImageSpanAlignment.CENTER),objectFit:(ImageFit.Contain)}} + console.info("Stage_RichEditor_Test_2700 InsertValue is: " + JSON.stringify(RichEditorTextSpan)) + console.info("Stage_RichEditor_Test_2700 InsertValue is: " + JSON.stringify(RichEditorImageSpan)) + expect(typeof RichEditorTextSpan).assertEqual("object") + expect(typeof RichEditorImageSpan).assertEqual("object") + expect(RichEditorTextSpan.spanPosition.spanIndex).assertEqual(10) + expect(RichEditorTextSpan.spanPosition.spanRange[0]).assertEqual(10) + expect(RichEditorTextSpan.spanPosition.spanRange[1]).assertEqual(10) + expect(RichEditorImageSpan.spanPosition.spanIndex).assertEqual(10) + expect(RichEditorImageSpan.spanPosition.spanRange[0]).assertEqual(10) + expect(RichEditorImageSpan.spanPosition.spanRange[1]).assertEqual(10) + console.info('Stage_RichEditor_Test_2700 END '); + } catch(err) { + expect().assertFail() + console.info('Stage_RichEditor_Test_2700 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); }) }