"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.E2EInputTest = exports.filledIconProps = exports.outlineIconProps = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var input_1 = require("@fluentui-react-native/input");
var stack_1 = require("@fluentui-react-native/stack");
var text_1 = require("@fluentui-react-native/text");
var consts_1 = require("../../../../E2E/src/Input/consts");
var filledIcon_svg_1 = tslib_1.__importDefault(require("../../../assets/filledIcon.svg"));
var outlineIcon_svg_1 = tslib_1.__importDefault(require("../../../assets/outlineIcon.svg"));
var styles_1 = require("../Common/styles");
var TestProps_1 = require("../Common/TestProps");
exports.outlineIconProps = { svgSource: { src: outlineIcon_svg_1.default, viewBox: '0 0 20 20' } };
exports.filledIconProps = { svgSource: { src: filledIcon_svg_1.default, viewBox: '0 0 20 20' } };
var E2EInputTest = function () {
    var _a = React.useState(''), error = _a[0], setError = _a[1];
    var _b = React.useState(consts_1.INPUT_START_STRING), text = _b[0], setText = _b[1];
    return (React.createElement(stack_1.Stack, { style: styles_1.stackStyle },
        React.createElement(text_1.Text
        /* For Android E2E testing purposes, testProps must be passed in after accessibilityLabel. */
        , tslib_1.__assign({}, (0, TestProps_1.testProps)(consts_1.INPUT_TEXT)), text),
        React.createElement(input_1.Input, tslib_1.__assign({ error: error, defaultIcon: exports.outlineIconProps, value: text, focusedStateIcon: exports.filledIconProps, textInputProps: { autoFocus: true }, placeholder: "Only text upto 5 characters!", assistiveText: "Assistive Text", label: "Label", onChange: function (text) {
                setText(text);
                if (text.length > 5) {
                    setError('Text must be less than 5 characters!');
                    setText(consts_1.INPUT_ERROR_STRING);
                }
                else {
                    setError('');
                }
            } }, (0, TestProps_1.testProps)(consts_1.INPUT_TEST_COMPONENT), { accessoryIconAccessibilityLabel: consts_1.INPUT_TEST_COMPONENT_DISMISS_BUTTON, accessoryButtonOnPress: function () {
                setText(consts_1.INPUT_ONCLICK_STRING);
            } }))));
};
exports.E2EInputTest = E2EInputTest;
//# sourceMappingURL=E2EInputTest.js.map