-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Patch `Promise.constructor` differently * Patch `Promise.constructor` differently * Add changelog entry, extend comment
- Loading branch information
Showing
7 changed files
with
3,105 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<main> | ||
<form> | ||
<p>A Friendly Captcha widget on the same page as Zone.js (used in Angular).</p> | ||
|
||
<input type="textarea"/> | ||
<div class="frc-captcha" data-sitekey="{{ .Config.Sitekey }}"></div> | ||
<input type="submit"/> | ||
</form> | ||
</main> | ||
|
||
<script defer src="{{ .SiteJSPath }}"></script> | ||
<script defer src="main.tmpl.ts"></script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*! | ||
* Copyright (c) Friendly Captcha GmbH 2023. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
import { sdktest } from "../../sdktestlib/sdk.js"; | ||
|
||
import "./zone.umd.js" | ||
|
||
sdktest.description("Together with zone.js"); | ||
|
||
sdktest.test({ name: "one widget present" }, async (t) => { | ||
t.require.numberOfWidgets(1); | ||
}); | ||
|
||
sdktest.test({ name: "promises resolve" }, async (t) => { | ||
|
||
const p = new Promise((resolve) => { | ||
setTimeout(() => { | ||
resolve("OK"); | ||
}, 10); | ||
}) | ||
|
||
const result = await p; | ||
|
||
t.assert.equal(result, "OK"); | ||
|
||
let didResolve = false; | ||
|
||
await Promise.resolve("abc").then((result) => { | ||
t.assert.equal(result, "abc"); | ||
didResolve = true; | ||
}); | ||
|
||
t.assert.truthy(didResolve); | ||
}); |
Oops, something went wrong.