1
import {strict as assert} from 'assert';
3
import {toArray, toStr, toInt32} from "../unit_utils"
4
import {RuntimeType, Tags} from "@arkoala/arkui/SerializerBase"
5
import {Serializer} from "@arkoala/arkui/Serializer"
17
it('Test BackgroundBlurStyleOptions serializer has superclass', function () {
18
let serializer = new Serializer()
19
let blurOptions: BlurOptions = {
22
let backgroundBlurStyleOptions: BackgroundBlurStyleOptions = {
23
colorMode: ThemeColorMode.SYSTEM,
24
adaptiveColor: AdaptiveColor.DEFAULT,
26
blurOptions: blurOptions,
28
serializer.writeBackgroundBlurStyleOptions(backgroundBlurStyleOptions)
29
assert.deepEqual(toArray(serializer), [
30
RuntimeType.NUMBER, ...toInt32(ThemeColorMode.SYSTEM),
31
RuntimeType.NUMBER, ...toInt32(AdaptiveColor.DEFAULT),
32
RuntimeType.NUMBER, Tags.INT32, ...toInt32(1),
33
RuntimeType.OBJECT, RuntimeType.OBJECT, Tags.INT32, ...toInt32(2), Tags.INT32, ...toInt32(3)
37
it('Test bindSheet serializer has superclass', function () {
38
let serializer = new Serializer()
39
let resource: Resource = { id: 43, bundleName: "MyApp", moduleName: "MyApp" }
40
let sheetTitle: SheetTitleOptions = {
43
serializer.writeSheetOptions({
44
backgroundColor: '#00ffffff',
47
assert.deepEqual(toArray(serializer), [
48
RuntimeType.STRING, RuntimeType.STRING, ...toStr("#00ffffff"),
50
RuntimeType.OBJECT, ...toStr(JSON.stringify(resource)),
51
RuntimeType.UNDEFINED,