From e0d9a35917b1666d1964eb0ca11adc0c21338a21 Mon Sep 17 00:00:00 2001 From: bayanxing Date: Mon, 21 Feb 2022 16:26:58 +0800 Subject: [PATCH] add button attrs testcase Signed-off-by: bayanxing --- .../js/default/pages/button/router/index.js | 2 +- .../js/default/pages/button/style/index.js | 14 ++++++++++ .../js/default/pages/divider/prop/index.hml | 7 ----- .../js/default/pages/divider/prop/index.js | 12 ++------- .../js/default/pages/divider/router/index.js | 2 +- .../main/js/default/test/buttonProps.test.js | 27 ++++++++++++------- 6 files changed, 35 insertions(+), 29 deletions(-) diff --git a/ace/ace_standard/src/main/js/default/pages/button/router/index.js b/ace/ace_standard/src/main/js/default/pages/button/router/index.js index 1deae6639..038ade784 100644 --- a/ace/ace_standard/src/main/js/default/pages/button/router/index.js +++ b/ace/ace_standard/src/main/js/default/pages/button/router/index.js @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022 Shenzhen kaiHong Digital Industry Development Co., Ltd. + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ace/ace_standard/src/main/js/default/pages/button/style/index.js b/ace/ace_standard/src/main/js/default/pages/button/style/index.js index e69de29bb..4a45d3eb1 100644 --- a/ace/ace_standard/src/main/js/default/pages/button/style/index.js +++ b/ace/ace_standard/src/main/js/default/pages/button/style/index.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/divider/prop/index.hml b/ace/ace_standard/src/main/js/default/pages/divider/prop/index.hml index b49f099b1..76473a8fa 100644 --- a/ace/ace_standard/src/main/js/default/pages/divider/prop/index.hml +++ b/ace/ace_standard/src/main/js/default/pages/divider/prop/index.hml @@ -140,13 +140,6 @@ - - - - - 渲染属性 -- show diff --git a/ace/ace_standard/src/main/js/default/pages/divider/prop/index.js b/ace/ace_standard/src/main/js/default/pages/divider/prop/index.js index b27067929..e3d1971b9 100644 --- a/ace/ace_standard/src/main/js/default/pages/divider/prop/index.js +++ b/ace/ace_standard/src/main/js/default/pages/divider/prop/index.js @@ -45,8 +45,6 @@ export default { forPropOne : null, forPropThree : null, ifPropTrue : null, - ifPropFalse : null, - ifPropNone : null, showPropTrue : null, showPropFalse : null, showPropNone : null, @@ -84,8 +82,6 @@ export default { forPropOne : this.forPropOne, forPropThree : this.forPropThree, ifPropTrue : this.ifPropTrue, - ifPropFalse : this.ifPropFalse, - ifPropNone : this.ifPropNone, showPropTrue : this.showPropTrue, showPropFalse : this.showPropFalse, showPropNone : this.showPropNone, @@ -121,16 +117,12 @@ export default { this.forPropOne = this.$element("forPropOne").getInspector() this.forPropThree = this.$element("forPropThree").getInspector() this.ifPropTrue = this.$element("ifPropTrue").getInspector() - this.ifPropFalse = this.$element("ifPropFalse").getInspector() - this.ifPropNone = this.$element("ifPropNone").getInspector() this.showPropTrue = this.$element("showPropTrue").getInspector() this.showPropFalse = this.$element("showPropFalse").getInspector() this.showPropNone = this.$element("showPropNone").getInspector() - return }, getSpecificPropValues () { - this.verticalTrue = this.$element("showPropNone").getInspector() - this.verticalTrue = this.$element("showPropNone").getInspector() - return + this.verticalTrue = this.$element("verticalTrue").getInspector() + this.verticalFalse = this.$element("verticalFalse").getInspector() } } diff --git a/ace/ace_standard/src/main/js/default/pages/divider/router/index.js b/ace/ace_standard/src/main/js/default/pages/divider/router/index.js index e778c4f80..4988a2eb6 100644 --- a/ace/ace_standard/src/main/js/default/pages/divider/router/index.js +++ b/ace/ace_standard/src/main/js/default/pages/divider/router/index.js @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022 Shenzhen kaiHong Digital Industry Development Co., Ltd. + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ace/ace_standard/src/main/js/default/test/buttonProps.test.js b/ace/ace_standard/src/main/js/default/test/buttonProps.test.js index 408d3d119..2af88600e 100644 --- a/ace/ace_standard/src/main/js/default/test/buttonProps.test.js +++ b/ace/ace_standard/src/main/js/default/test/buttonProps.test.js @@ -1,10 +1,10 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -32,7 +32,7 @@ describe('buttonPropsJsTest', function () { let backToIndexPromise = new Promise((resolve, reject) => { setTimeout(() => { router.back({ - uri: 'pages/button/prop/index' + uri: 'pages/index/index' }); resolve(); }, 500); @@ -47,6 +47,7 @@ describe('buttonPropsJsTest', function () { return clearPromise; }); } + /** * run before testcase */ @@ -77,6 +78,7 @@ describe('buttonPropsJsTest', function () { }); // 通用属性 + /** * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 * @tc.name testButtonIdProp @@ -95,6 +97,11 @@ describe('buttonPropsJsTest', function () { done(); }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testButtonClassProp + * @tc.desc ACE + */ it('testButtonClassProp', 0, async function (done) { console.info('testButtonClassProp START'); console.info("[buttonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); @@ -610,7 +617,7 @@ describe('buttonPropsJsTest', function () { expect(obj.$type).assertEqual('button') expect(obj.$attrs.id).assertEqual('showPropNone') - expect(obj.$attrs.show).assertEqual('false') + expect(obj.$attrs.show).assertEqual('true') console.info("[buttonProps] get show value is: " + JSON.stringify(obj.$attrs.show)); done(); }); @@ -732,7 +739,7 @@ describe('buttonPropsJsTest', function () { expect(obj.$type).assertEqual('button') expect(obj.$attrs.id).assertEqual('typeNone') - expect(obj.$attrs.type).assertEqual(undefined) + expect(obj.$attrs.type).assertEqual('capsule') console.info("[buttonProps] get type value is: " + JSON.stringify(obj.$attrs.type)); done(); }); @@ -912,7 +919,7 @@ describe('buttonPropsJsTest', function () { expect(obj.$type).assertEqual('button') expect(obj.$attrs.id).assertEqual('placementNone') - expect(obj.$attrs.placement).assertEqual(undefined) + expect(obj.$attrs.placement).assertEqual('end') console.info("[buttonProps] get placement value is: " + JSON.stringify(obj.$attrs.placement)); done(); }); @@ -932,7 +939,7 @@ describe('buttonPropsJsTest', function () { expect(obj.$type).assertEqual('button') expect(obj.$attrs.id).assertEqual('waitingTrue') - expect(obj.$attrs.waiting).assertEqual(true) + expect(obj.$attrs.waiting).assertEqual('true') console.info("[buttonProps] get waiting value is: " + JSON.stringify(obj.$attrs.waiting)); done(); }); @@ -952,7 +959,7 @@ describe('buttonPropsJsTest', function () { expect(obj.$type).assertEqual('button') expect(obj.$attrs.id).assertEqual('waitingFalse') - expect(obj.$attrs.waiting).assertEqual(false) + expect(obj.$attrs.waiting).assertEqual('false') console.info("[buttonProps] get waiting value is: " + JSON.stringify(obj.$attrs.waiting)); done(); }); @@ -972,7 +979,7 @@ describe('buttonPropsJsTest', function () { expect(obj.$type).assertEqual('button') expect(obj.$attrs.id).assertEqual('waitingNone') - expect(obj.$attrs.waiting).assertEqual(undefined) + expect(obj.$attrs.waiting).assertEqual('false') console.info("[buttonProps] get waiting value is: " + JSON.stringify(obj.$attrs.waiting)); done(); }); -- GitLab