otpcredential-store.https.html (713B)
1 <!DOCTYPE html> 2 <link rel="help" href="https://github.com/WICG/WebOTP"> 3 <title>Tests OTPCredential handing of store()</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script type="module"> 7 import {Status, expectOTPRequest} from "./support/otpcredential-helper.js"; 8 9 promise_test(async t => { 10 await expectOTPRequest().andReturn( 11 () => ({status: Status.SUCCESS, otp: "ABC"})); 12 13 const cred = await navigator.credentials.get({otp: {transport: ["sms"]}}); 14 return promise_rejects_dom(t, "NotSupportedError", navigator.credentials.store(cred)); 15 }, "navigator.credentials.store() with an otp credential returns NotSupportedError"); 16 17 </script>