mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 10:57:04 +08:00
FIX: Don't fail if the test environment doesn't support Webauthn
This commit is contained in:
parent
c150566506
commit
1859e6b7ca
|
@ -256,14 +256,19 @@ QUnit.test("second factor security keys", async assert => {
|
|||
assert.ok(exists("#security-key-name"), "shows security key name input");
|
||||
|
||||
fillIn("#security-key-name", "");
|
||||
await click(".add-security-key");
|
||||
|
||||
assert.ok(
|
||||
find(".alert-error")
|
||||
.html()
|
||||
.indexOf("provide a name") > -1,
|
||||
"shows name missing error message"
|
||||
);
|
||||
// The following tests can only run when Webauthn is enabled. This is not
|
||||
// always the case, for example on a browser running on a non-standard port
|
||||
if (typeof PublicKeyCredential !== "undefined") {
|
||||
await click(".add-security-key");
|
||||
|
||||
assert.ok(
|
||||
find(".alert-error")
|
||||
.html()
|
||||
.indexOf("provide a name") > -1,
|
||||
"shows name missing error message"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.test("default avatar selector", async assert => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user