and its fields.';
+
+/* The reasons when a native form stops after it was chosen. */
+export const DID_NOT_START = "The card form did not start in the vault's engine.";
+export const STOPPED = "The card form stopped in the vault's engine. Whatever was typed is gone.";
+export const FIELD_STOPPED = "A card field stopped in the vault's engine. Whatever was typed is gone.";
diff --git a/packages/@juspay-tech/react-native-hyperswitch-vault/src/public.ts b/packages/@juspay-tech/react-native-hyperswitch-vault/src/public.ts
index 80fb2366..9ab5bb8a 100644
--- a/packages/@juspay-tech/react-native-hyperswitch-vault/src/public.ts
+++ b/packages/@juspay-tech/react-native-hyperswitch-vault/src/public.ts
@@ -112,7 +112,15 @@ type MerchantProps = Omit
void;
};
-export type CardFormProps = MerchantProps;
+export type CardFormProps = MerchantProps & {
+ /*
+ * Called once when the card fields cannot run in this app, or stop while running, with
+ * `unsupported_configuration` and a message saying why. The card fields are native only: there is
+ * no plain fallback in the app's own JavaScript, so in that case the form draws no field and
+ * tokenize() is refused with the same code.
+ */
+ readonly onError?: (error: SafeVaultError) => void;
+};
export type HyperswitchVaultFormProps = MerchantProps;
type FieldProps = Omit
& {
diff --git a/packages/@juspay-tech/react-native-hyperswitch-vault/src/specs/HyperswitchVaultFieldViewNativeComponent.ts b/packages/@juspay-tech/react-native-hyperswitch-vault/src/specs/HyperswitchVaultFieldViewNativeComponent.ts
new file mode 100644
index 00000000..81c7edf4
--- /dev/null
+++ b/packages/@juspay-tech/react-native-hyperswitch-vault/src/specs/HyperswitchVaultFieldViewNativeComponent.ts
@@ -0,0 +1,24 @@
+/*
+ * The native view that shows one card field from the vault's own engine. Read by Codegen when the
+ * merchant's app is built. The vault's JavaScript does not import this file: it registers the same
+ * view by name with a hand-written view config (src/native/fieldView.mjs), which must list the
+ * same props and the same event.
+ */
+import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
+import type { ViewProps } from 'react-native';
+import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
+
+export interface NativeProps extends ViewProps {
+ formId: string;
+ elementType: string;
+ /* The field's data props, as JSON text. */
+ settings?: string;
+ onFieldEvent?: DirectEventHandler<{
+ name: string;
+ payload: string;
+ }>;
+}
+
+export default codegenNativeComponent('HyperswitchVaultFieldView', {
+ excludedPlatforms: ['iOS'],
+});
diff --git a/packages/@juspay-tech/react-native-hyperswitch-vault/src/specs/NativeHyperswitchVaultForms.ts b/packages/@juspay-tech/react-native-hyperswitch-vault/src/specs/NativeHyperswitchVaultForms.ts
new file mode 100644
index 00000000..f72d33d5
--- /dev/null
+++ b/packages/@juspay-tech/react-native-hyperswitch-vault/src/specs/NativeHyperswitchVaultForms.ts
@@ -0,0 +1,38 @@
+/*
+ * The native module the MERCHANT's engine talks to: it opens, updates and closes card forms in the
+ * vault's own engine, and carries commands to them.
+ *
+ * This file is read by React Native's Codegen when the merchant's app is built, to generate the
+ * native interface. The vault's JavaScript does not import it: it finds the module by name
+ * ('HyperswitchVaultForms'), so the package's built JavaScript needs no build step in the app.
+ *
+ * `settings` and every `payload` are JSON text. One string is the same on every React Native
+ * version, where a typed object is not.
+ */
+import type { TurboModule } from 'react-native';
+import { TurboModuleRegistry } from 'react-native';
+import type { EventEmitter, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
+
+export type VaultFormEvent = {
+ formId: string;
+ name: string;
+ payload: string;
+};
+
+export interface Spec extends TurboModule {
+ /* Read once, to decide whether the native path can run in this app. */
+ getConstants(): {
+ newArchitecture: boolean;
+ reactNativeMinor: Int32;
+ protocolVersion: Int32;
+ bundled: boolean;
+ };
+ openForm(formId: string, settings: string): void;
+ updateForm(formId: string, settings: string): void;
+ closeForm(formId: string): void;
+ /* Always resolves, never rejects: with the command's result as JSON text. */
+ sendCommand(formId: string, name: string, elementType: string): Promise;
+ readonly onFormEvent: EventEmitter;
+}
+
+export default TurboModuleRegistry.get('HyperswitchVaultForms');
diff --git a/packages/@juspay-tech/react-native-hyperswitch-vault/src/specs/NativeHyperswitchVaultHosted.ts b/packages/@juspay-tech/react-native-hyperswitch-vault/src/specs/NativeHyperswitchVaultHosted.ts
new file mode 100644
index 00000000..81095ec8
--- /dev/null
+++ b/packages/@juspay-tech/react-native-hyperswitch-vault/src/specs/NativeHyperswitchVaultHosted.ts
@@ -0,0 +1,31 @@
+/*
+ * The native module the vault's OWN engine talks to (src/hosted/bridge.mjs). It exists only in that
+ * engine: the merchant's engine never has it. Events go out through it, and commands come in.
+ *
+ * `rootTag` is the tag of the React root the event comes from, or the command goes to. Native code
+ * finds the owner of that root by it.
+ */
+import type { TurboModule } from 'react-native';
+import { TurboModuleRegistry } from 'react-native';
+import type { EventEmitter, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
+
+export type VaultCommand = {
+ rootTag: Int32;
+ formId: string;
+ commandId: string;
+ name: string;
+ elementType?: string;
+ /*
+ * On `tokenize` only: the form's settings (JSON text) the save was accepted with. The bundle
+ * applies them before it tokenizes (hosted/commands.mjs).
+ */
+ settings?: string;
+};
+
+export interface Spec extends TurboModule {
+ emitFieldEvent(rootTag: Int32, eventName: string, payload: string): void;
+ emitFormEvent(rootTag: Int32, eventName: string, payload: string): void;
+ readonly onCommand: EventEmitter;
+}
+
+export default TurboModuleRegistry.get('HyperswitchVaultHosted');
diff --git a/packages/@juspay-tech/react-native-hyperswitch-vault/src/standalone-entry.mjs b/packages/@juspay-tech/react-native-hyperswitch-vault/src/standalone-entry.mjs
index 00e54baf..36ebd0a1 100644
--- a/packages/@juspay-tech/react-native-hyperswitch-vault/src/standalone-entry.mjs
+++ b/packages/@juspay-tech/react-native-hyperswitch-vault/src/standalone-entry.mjs
@@ -5,9 +5,8 @@
* there executes). The two must agree; `scripts/verify-public-surface.mjs` fails the build if they
* drift.
*
- * Everything below is a binding over the ReScript components. No wrapper component: a wrapper
- * would break `===` identity, add a render frame, and give React.memo and devtools a second name
- * for the same thing.
+ * The form and the fields are small choosers over the ReScript components (see below): one render
+ * frame that decides where the field runs. Everything else is a direct binding.
*
* The names are the web SDK's: `cardNumber`, `cardExpiry`, `cardCvc` become `CardNumberField`,
* `CardExpiryField`, `CardCVCField`. The legacy `*Widget` spellings, the `HyperswitchVault`
@@ -16,19 +15,27 @@
*/
import { make as HyperswitchVaultFormImpl } from './HyperswitchVaultForm.bs.js';
-import { make as CardFormImpl } from './CardForm.bs.js';
-import { make as CardNumberFieldImpl } from './CardNumberField.bs.js';
-import { make as CardExpiryFieldImpl } from './CardExpiryField.bs.js';
-import { make as CardCVCFieldImpl } from './CardCVCField.bs.js';
-import { make as CardholderNameFieldImpl } from './CardholderNameField.bs.js';
+import {
+ CardForm as CardFormChooser,
+ CardNumberField as CardNumberFieldChooser,
+ CardExpiryField as CardExpiryFieldChooser,
+ CardCVCField as CardCVCFieldChooser,
+ CardholderNameField as CardholderNameFieldChooser,
+ createDetachedCardForm as createDetachedCardFormChooser,
+} from './native/choosers.mjs';
import { createCardForm as createCardFormImpl } from './createCardForm.mjs';
-import { createDetachedCardForm as createDetachedCardFormImpl } from './createDetachedCardForm.mjs';
-export const CardForm = CardFormImpl;
-export const CardNumberField = CardNumberFieldImpl;
-export const CardExpiryField = CardExpiryFieldImpl;
-export const CardCVCField = CardCVCFieldImpl;
-export const CardholderNameField = CardholderNameFieldImpl;
+/*
+ * The form and its fields run on the native path only (each field a native view whose content runs
+ * in the vault's own engine). Where that cannot run, the form reports unsupported_configuration
+ * through onError and tokenize(), and draws no field; inside an SDK's own engine the plain fields
+ * render. The rule is in ./native/choosers.mjs and ./native/availability.mjs.
+ */
+export const CardForm = CardFormChooser;
+export const CardNumberField = CardNumberFieldChooser;
+export const CardExpiryField = CardExpiryFieldChooser;
+export const CardCVCField = CardCVCFieldChooser;
+export const CardholderNameField = CardholderNameFieldChooser;
/* The ready-made form: the same provider with the four fields laid out by the library. */
export const HyperswitchVaultForm = HyperswitchVaultFormImpl;
@@ -40,7 +47,9 @@ export const HyperswitchVaultForm = HyperswitchVaultFormImpl;
export const createCardForm = createCardFormImpl;
/*
- * A card form whose fields each sit in a React root of their own (one native view per field).
- * Exported from the root only: no subpath, so every React Native version's Metro resolves it.
+ * A card form whose fields each sit in a React root of their own (one native view per field), for an
+ * SDK's own engine. In an app's own JavaScript it refuses (native fields only: its fields would be
+ * plain inputs there); see ./native/choosers.mjs. Exported from the root only: no subpath, so every
+ * React Native version's Metro resolves it.
*/
-export const createDetachedCardForm = createDetachedCardFormImpl;
+export const createDetachedCardForm = createDetachedCardFormChooser;
diff --git a/packages/@juspay-tech/react-native-hyperswitch-vault/test/native.test.mjs b/packages/@juspay-tech/react-native-hyperswitch-vault/test/native.test.mjs
new file mode 100644
index 00000000..1c4109bd
--- /dev/null
+++ b/packages/@juspay-tech/react-native-hyperswitch-vault/test/native.test.mjs
@@ -0,0 +1,256 @@
+// The merchant-side wrappers' parts that need no React: the rule for when the native path may run,
+// what is sent to the vault's own engine, and how its answers are read back.
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+
+import { DID_NOT_START, NO_NATIVE_MODULE, STOPPED, supports, whyNot } from '../src/native/rule.mjs';
+import { fieldOut, formSettings, read, settingsChangedMessage, tokenizeResultOf } from '../src/native/out.mjs';
+import { forwardingHandle, idleFieldHandle, refusingHandle, unsupportedError } from '../src/native/handle.mjs';
+import { PROTOCOL_VERSION, TESTED_REACT_NATIVE } from '../src/hosted/protocol.mjs';
+
+const good = { newArchitecture: true, bundled: true, protocolVersion: PROTOCOL_VERSION, reactNativeMinor: 86 };
+/* StyleSheet.flatten, near enough: arrays merged left to right, falsy entries skipped. */
+const flatten = (style) => (Array.isArray(style) ? Object.assign({}, ...style.flat(Infinity).filter(Boolean)) : style ?? undefined);
+
+test('rule: the native path runs only when every condition holds', () => {
+ assert.equal(supports(good), true);
+ assert.equal(supports({ ...good, newArchitecture: false }), false, 'old architecture');
+ assert.equal(supports({ ...good, bundled: false }), false, 'a build without the bundle');
+ assert.equal(supports({ ...good, protocolVersion: PROTOCOL_VERSION + 1 }), false, 'JavaScript newer than the app');
+ assert.equal(supports({ ...good, protocolVersion: PROTOCOL_VERSION - 1 }), false, 'JavaScript older than the app');
+ assert.equal(supports(null), false);
+ assert.equal(supports(undefined), false);
+ assert.equal(supports({}), false);
+ assert.equal(supports({ ...good, reactNativeMinor: '86' }), false, 'a version that is not a number');
+});
+
+test('rule: only the tested React Native versions, at both ends', () => {
+ assert.equal(supports({ ...good, reactNativeMinor: TESTED_REACT_NATIVE.from }), true);
+ assert.equal(supports({ ...good, reactNativeMinor: TESTED_REACT_NATIVE.to }), true);
+ assert.equal(supports({ ...good, reactNativeMinor: TESTED_REACT_NATIVE.from - 1 }), false, 'older than tested');
+ assert.equal(supports({ ...good, reactNativeMinor: TESTED_REACT_NATIVE.to + 1 }), false, 'newer than tested');
+});
+
+test('out: a form sends its data props and nothing else', () => {
+ const sent = JSON.parse(
+ formSettings({
+ vaultDetails: { vaultType: 'hyperswitch', vaultData: { sdkAuthorization: 'abc' } },
+ environment: 'SANDBOX',
+ locale: 'fr',
+ disabled: false,
+ onChange: () => {},
+ onReady: () => {},
+ children: 'x',
+ ref: {},
+ somethingElse: 1,
+ })
+ );
+ assert.deepEqual(sent, {
+ vaultDetails: { vaultType: 'hyperswitch', vaultData: { sdkAuthorization: 'abc' } },
+ environment: 'SANDBOX',
+ locale: 'fr',
+ disabled: false,
+ });
+});
+
+test('out: equal props give equal text, so a re-render sends no update', () => {
+ const props = () => ({ environment: 'SANDBOX', appearance: { variables: { colorText: '#000' } }, onChange: () => {} });
+ assert.equal(formSettings(props()), formSettings(props()));
+ assert.notEqual(formSettings(props()), formSettings({ ...props(), locale: 'de' }));
+});
+
+test('out: a field sends its data props; callbacks and unknown props stay behind', () => {
+ const { settings, placement } = fieldOut(
+ { placeholder: 'Card', labelBehavior: 'floating', options: { savedCard: { paymentMethodToken: 'pm_1' } }, onChange: () => {}, style: { color: 'red' } },
+ flatten
+ );
+ assert.deepEqual(JSON.parse(settings), {
+ placeholder: 'Card',
+ labelBehavior: 'floating',
+ options: { savedCard: { paymentMethodToken: 'pm_1' } },
+ });
+ assert.deepEqual(placement, {});
+});
+
+test('out: where the field sits goes on the native view; how it looks goes inside', () => {
+ const { settings, placement } = fieldOut(
+ {
+ styles: {
+ root: [{ flex: 1, marginTop: 8 }, { padding: 4, backgroundColor: '#fff', width: 200 }],
+ input: { color: '#111', fontSize: 16 },
+ error: null,
+ },
+ },
+ flatten
+ );
+ assert.deepEqual(placement, { flex: 1, marginTop: 8, width: 200 });
+ assert.deepEqual(JSON.parse(settings).styles, {
+ root: { padding: 4, backgroundColor: '#fff' },
+ input: { color: '#111', fontSize: 16 },
+ });
+});
+
+test('out: unreadable text from the other side is an empty object, never an exception', () => {
+ assert.deepEqual(read('{"height":48}'), { height: 48 });
+ assert.deepEqual(read('{not json'), {});
+ assert.deepEqual(read('[1,2]').length, 2);
+ assert.deepEqual(read('"text"'), {});
+ assert.deepEqual(read(undefined), {});
+ assert.deepEqual(read('null'), {});
+});
+
+test('out: a tokenize answer is the vault\'s result; one that never reached the engine is unsupported_configuration', () => {
+ const result = { status: 'success', token: 'tok_123', card: { last4: '4242', expiryMonth: '12', expiryYear: '2030' } };
+ assert.deepEqual(tokenizeResultOf(JSON.stringify({ commandId: 'c', name: 'tokenize', ok: true, result })), result);
+
+ const refused = { status: 'validation_error', error: { code: 'validation_error', message: 'Enter a card number.', type: 'validation_error' } };
+ assert.deepEqual(tokenizeResultOf(JSON.stringify({ ok: true, result: refused })), refused);
+
+ /* Native's refusal (no commandId): queued while the form started, then the start failed. */
+ assert.deepEqual(tokenizeResultOf(JSON.stringify({ ok: false, message: 'The card form did not start.' })), {
+ status: 'error',
+ error: { code: 'unsupported_configuration', message: 'The card form did not start.', type: 'api_error' },
+ });
+ /* The bundle's own refusal carries its commandId: an ordinary refusal, as before. */
+ assert.equal(
+ tokenizeResultOf(JSON.stringify({ commandId: 'c', name: 'tokenize', ok: false, message: 'x' })).error.code,
+ 'tokenization_failed'
+ );
+ for (const broken of ['{not json', '', undefined, '{"ok":true}', '{"ok":true,"result":null}']) {
+ const out = tokenizeResultOf(broken);
+ assert.equal(out.status, 'error');
+ assert.equal(out.error.code, 'tokenization_failed');
+ assert.equal(typeof out.error.message, 'string');
+ }
+});
+
+test('out: a tokenize that reached the vault\'s engine and got no answer is an unknown outcome, never a failure', () => {
+ for (const message of ['The card form did not answer.', 'The card form was closed.', "The card form's engine stopped."]) {
+ const out = tokenizeResultOf(JSON.stringify({ ok: false, message, delivered: true }));
+ assert.equal(out.status, 'error');
+ assert.equal(out.error.code, 'unknown_outcome');
+ assert.equal(out.error.type, 'api_error');
+ assert.equal(typeof out.error.message, 'string');
+ }
+ /* Not delivered (never reached the engine, nothing sent): the configuration error onError reports too. */
+ assert.equal(tokenizeResultOf(JSON.stringify({ ok: false, message: 'The card form is not open.' })).error.code, 'unsupported_configuration');
+ assert.equal(tokenizeResultOf(JSON.stringify({ ok: false, message: 'x', delivered: 'yes' })).error.code, 'unsupported_configuration');
+});
+
+test('out: a save that never reached the engine says what onError and every later save say', async () => {
+ /* Queued while the form started, then the start failed (native's own wording is never shown). */
+ for (const reason of [DID_NOT_START, STOPPED]) {
+ const first = tokenizeResultOf(JSON.stringify({ ok: false, message: 'The card form did not start.' }), reason);
+ const later = await refusingHandle(reason).tokenize();
+ assert.deepEqual(first, later, 'the queued save and a later save agree');
+ assert.equal(first.error.code, unsupportedError(reason).code, 'and agree with onError');
+ assert.equal(first.error.message, unsupportedError(reason).message);
+ }
+ /* A save already delivered stays an unknown outcome, whatever the form reports. */
+ assert.equal(
+ tokenizeResultOf(JSON.stringify({ ok: false, message: 'x', delivered: true }), DID_NOT_START).error.code,
+ 'unknown_outcome'
+ );
+});
+
+test('out: a queued save refused because the settings changed meanwhile is an ordinary, retryable failure', () => {
+ const out = tokenizeResultOf(
+ JSON.stringify({ ok: false, message: "The card form's settings changed before the save could run.", settingsChanged: true }),
+ DID_NOT_START
+ );
+ assert.deepEqual(out, {
+ status: 'error',
+ error: { code: 'tokenization_failed', message: settingsChangedMessage, type: 'api_error' },
+ });
+});
+
+test('handle: one object that follows whichever form is mounted, and refuses when none is', async () => {
+ let mounted = null;
+ const handle = forwardingHandle(() => mounted);
+
+ /* Nothing mounted: refusals, never a throw. */
+ assert.equal((await handle.tokenize()).error.code, 'incomplete_field_set');
+ assert.equal((await handle.confirmPayment({})).error.code, 'unsupported_configuration');
+ handle.reset();
+ handle.focus('cardNumber');
+
+ /* The native form (no confirmPayment), then a switch to the plain one: the same handle reaches each. */
+ const calls = [];
+ mounted = {
+ tokenize: async () => ({ status: 'success', token: 'from-native' }),
+ reset: () => calls.push('native reset'),
+ focus: (field) => calls.push(`native focus ${field}`),
+ };
+ assert.equal((await handle.tokenize()).token, 'from-native');
+ assert.equal((await handle.confirmPayment({})).error.code, 'unsupported_configuration');
+ handle.reset();
+ handle.focus('cardCvc');
+
+ mounted = {
+ tokenize: async () => ({ status: 'success', token: 'from-plain' }),
+ confirmPayment: async (input) => ({ status: 'succeeded', input }),
+ reset: () => calls.push('plain reset'),
+ focus: (field) => calls.push(`plain focus ${field}`),
+ };
+ assert.equal((await handle.tokenize()).token, 'from-plain');
+ assert.deepEqual(await handle.confirmPayment({ a: 1 }), { status: 'succeeded', input: { a: 1 } });
+ handle.reset();
+ handle.focus('cardExpiry');
+
+ assert.deepEqual(calls, ['native reset', 'native focus cardCvc', 'plain reset', 'plain focus cardExpiry']);
+});
+
+test('fieldOut: a box with a fixed width sizes the native view like the plain outer view', () => {
+ /* S2SDemo's saved-card CVC: straight in a row, sized by styles.container. */
+ const cvc = fieldOut({ styles: { container: { width: 68, height: 46, paddingHorizontal: 8, borderWidth: 1 } } }, flatten);
+ assert.deepEqual(cvc.placement, { width: 68 });
+
+ const framed = fieldOut(
+ { styles: { root: { paddingHorizontal: 4, borderLeftWidth: 1, borderWidth: 2 }, container: { width: 60, marginLeft: 3, marginHorizontal: 5 } } },
+ flatten
+ );
+ /* 60 + margins 3 (left wins) + 5, + padding 4 + 4, + border 1 (left wins) + 2 */
+ assert.equal(framed.placement.width, 60 + 3 + 5 + 4 + 4 + 1 + 2);
+
+ /* A width or flex the merchant put on the root decides instead; a box without a fixed width fills. */
+ assert.equal(fieldOut({ styles: { root: { width: 120 }, container: { width: 68 } } }, flatten).placement.width, 120);
+ assert.equal(fieldOut({ styles: { root: { flex: 1 }, container: { width: 68 } } }, flatten).placement.width, undefined);
+ assert.equal(fieldOut({ styles: { container: { width: '50%' } } }, flatten).placement.width, undefined);
+ assert.equal(fieldOut({ styles: { input: { fontSize: 13 } } }, flatten).placement.width, undefined);
+});
+
+test('rule: when the native path cannot run, the reason names the app\'s setup', () => {
+ assert.equal(whyNot(good), null);
+ assert.match(whyNot({ ...good, newArchitecture: false }), /new architecture/);
+ assert.match(whyNot({ ...good, bundled: false }), /built without the vault's engine/);
+ assert.match(whyNot({ ...good, protocolVersion: PROTOCOL_VERSION + 1 }), /Rebuild the app/);
+ assert.match(whyNot({ ...good, reactNativeMinor: 81 }), /React Native 0\.81 is not supported .*0\.82 to 0\.88/);
+ assert.match(whyNot({ ...good, reactNativeMinor: TESTED_REACT_NATIVE.to + 1 }), /not supported/);
+ assert.match(whyNot(null), /no information/);
+ assert.match(NO_NATIVE_MODULE, /not rebuilt/);
+ assert.match(NO_NATIVE_MODULE, /\/jest/, 'points unit tests at the Jest mock');
+});
+
+test('refusing form: every tokenize is refused with unsupported_configuration and the reason; nothing throws', async () => {
+ const handle = refusingHandle(STOPPED);
+ const first = await handle.tokenize();
+ assert.equal(first.status, 'error');
+ assert.equal(first.error.code, 'unsupported_configuration');
+ assert.equal(first.error.message, STOPPED);
+ assert.equal((await handle.tokenize()).error.code, 'unsupported_configuration', 'every time, not once');
+ assert.equal((await handle.confirmPayment({})).error.code, 'unsupported_configuration');
+ handle.reset();
+ handle.focus('cardNumber');
+
+ /* Through the one handle the merchant holds, after a native form stopped. */
+ const held = forwardingHandle(() => handle);
+ assert.equal((await held.tokenize()).error.message, STOPPED);
+
+ /* What onError receives, and a field's idle handle. */
+ assert.deepEqual(unsupportedError('why'), { code: 'unsupported_configuration', message: 'why', type: 'api_error' });
+ idleFieldHandle.focus();
+ idleFieldHandle.blur();
+ idleFieldHandle.clear();
+ assert.ok(Object.isFrozen(idleFieldHandle));
+});
+