1/* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License") 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import { describe, expect, it } from '@ohos/hypium'; 17import userAuth from '@ohos.userIAM.userAuth'; 18import LogUtils from '../../../../main/ets/common/utils/LogUtils'; 19 20const TAG = 'PageComTest'; 21 22export default function PageComTest() { 23 describe('PageComTest', () => { 24 it('clickEventOk_Input', 0, async (done: Function) => { 25 const authParam : userAuth.AuthParam = { 26 challenge: new Uint8Array([49, 49, 49, 49, 49, 49]), 27 authType: [1, 2, 4], 28 authTrustLevel: 10000, 29 }; 30 const widgetParam : userAuth.WidgetParam = { 31 title: '使用密码验证', 32 windowMode: 1, 33 navigationButtonText: '确认', 34 }; 35 let userAuthInstance = await userAuth.getUserAuthInstance(authParam, widgetParam); 36 userAuthInstance.on('result', { 37 onResult (result) { 38 LogUtils.info(TAG, 'userAuthInstance onResult: ' + JSON.stringify(result)); 39 } 40 }); 41 expect(userAuthInstance).not().assertNull(); 42 done(); 43 }) 44 }) 45}