From cc7aa374a41ad5eef23ffa70b7ca0b93c38ea59a Mon Sep 17 00:00:00 2001 From: y00314596 Date: Thu, 6 Jan 2022 11:43:11 +0800 Subject: [PATCH] add api cases by yangqing3@huawei.com Signed-off-by: y00314596 --- .../intljs/src/main/js/default/test/Intl.test.js | 13 +++++++++++++ .../src/main/js/default/test/Resmgr.test.js | 1 + 2 files changed, 14 insertions(+) diff --git a/global/i18n_standard/intljs/src/main/js/default/test/Intl.test.js b/global/i18n_standard/intljs/src/main/js/default/test/Intl.test.js index 510c1b705..9390855e1 100755 --- a/global/i18n_standard/intljs/src/main/js/default/test/Intl.test.js +++ b/global/i18n_standard/intljs/src/main/js/default/test/Intl.test.js @@ -1056,6 +1056,19 @@ describe('intlTest', function () { expect(numfmt.format(123456.789)).assertEqual('+¥123,457'); }) + /* * + * @tc.number SUB_GLOBAL_INTL_JS_NUMBER_2250 + * @tc.name format the number with unitUsage + * @tc.desc check the number with unitUsage + */ + it('formatNumber_test_2250', 0, function () { + let numfmt = new intl.NumberFormat('zh-CN', { style: 'unit', unit: 'meter', + unitDisplay: 'long', unitUsage: 'length-road' }); + console.log('formatNumber_test_2250 ' + numfmt.format(123456.789)); + expect(numfmt.format(123456.789)).assertEqual('123,456.789米'); + expect(numfmt.resolvedOptions().unitUsage).assertEqual('length-road'); + }) + /* * * @tc.number SUB_GLOBAL_INTL_JS_NUMBER_2100 * @tc.name format the number with signDisplay diff --git a/global/resmgr_standard/resmgrjs/src/main/js/default/test/Resmgr.test.js b/global/resmgr_standard/resmgrjs/src/main/js/default/test/Resmgr.test.js index a19ee14fe..d0af514b4 100755 --- a/global/resmgr_standard/resmgrjs/src/main/js/default/test/Resmgr.test.js +++ b/global/resmgr_standard/resmgrjs/src/main/js/default/test/Resmgr.test.js @@ -242,6 +242,7 @@ describe('resMgrTest', function () { dc.screenDensity = ScreenDensity.SCREEN_XXLDPI; dc.deviceType = DeviceType.DEVICE_TYPE_WEARABLE; dc.screenDensity = ScreenDensity.SCREEN_XXXLDPI; + dc.deviceType = DeviceType.DEVICE_TYPE_PC; expect(dc !== null).assertTrue(); console.log('getDeviceCapability_test_002 ' + dc); }) -- GitLab