"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SpinnerTest = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var react_native_1 = require("react-native");
var spinner_1 = require("@fluentui-react-native/spinner");
var stack_1 = require("@fluentui-react-native/stack");
var text_1 = require("@fluentui-react-native/text");
var SpinnerE2ETest_1 = require("./SpinnerE2ETest");
var consts_1 = require("../../../../E2E/src/Spinner/consts");
var styles_1 = require("../Common/styles");
var Test_1 = require("../Test");
var BasicSpinnerTest = function () {
    var _a = React.useState('active'), status = _a[0], setStatus = _a[1];
    var _b = React.useState(true), hidesWhenStopped = _b[0], setHidesWhenStopped = _b[1];
    return (React.createElement(stack_1.Stack, { style: styles_1.stackStyle },
        React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.root },
            React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.settings },
                React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.switch },
                    React.createElement(text_1.Text, null, "Animating"),
                    React.createElement(react_native_1.Switch, { value: status === 'active', onValueChange: function (value) {
                            value ? setStatus('active') : setStatus('inactive');
                        } })),
                React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.switch },
                    React.createElement(text_1.Text, null, "HidesWhenStopped"),
                    React.createElement(react_native_1.Switch, { value: hidesWhenStopped, onValueChange: setHidesWhenStopped }))),
            React.createElement(spinner_1.Spinner, { status: status, hidesWhenStopped: hidesWhenStopped }))));
};
var CustomisedSpinner = spinner_1.Spinner.customize({
    trackColor: 'red',
    size: 'medium',
});
var SpinnerSizeTest = function () {
    var memoizedStyles = React.useMemo(function () { return (tslib_1.__assign(tslib_1.__assign({}, styles_1.commonTestStyles.androidContainer), { height: 250 })); }, []);
    return (React.createElement(stack_1.Stack, { style: styles_1.stackStyle },
        React.createElement(react_native_1.View, { style: memoizedStyles },
            React.createElement(react_native_1.View, null,
                React.createElement(text_1.TextV1, null, "xx-small"),
                React.createElement(spinner_1.Spinner, { size: "xx-small" })),
            React.createElement(react_native_1.View, null,
                React.createElement(text_1.TextV1, null, "x-small"),
                React.createElement(spinner_1.Spinner, { size: "x-small" })),
            React.createElement(react_native_1.View, null,
                React.createElement(text_1.TextV1, null, "medium"),
                React.createElement(spinner_1.Spinner, { size: "medium" })),
            React.createElement(react_native_1.View, null,
                React.createElement(text_1.TextV1, null, "large"),
                React.createElement(spinner_1.Spinner, { size: "large" })),
            React.createElement(react_native_1.View, null,
                React.createElement(text_1.TextV1, null, "x-large"),
                React.createElement(spinner_1.Spinner, { size: "x-large" })))));
};
var spinnerSections = [
    {
        name: 'Basic Spinner',
        testID: consts_1.SPINNER_TESTPAGE,
        component: BasicSpinnerTest,
    },
    {
        name: 'Spinner Size Test',
        component: SpinnerSizeTest,
    },
    {
        name: 'Customized Spinner Test',
        component: function () { return React.createElement(CustomisedSpinner, null); },
    },
    {
        name: 'Spinner for E2E Testing',
        component: function () { return React.createElement(SpinnerE2ETest_1.E2ETestingSpinner, null); },
    },
];
var SpinnerTest = function () {
    var status = {
        win32Status: 'Backlog',
        uwpStatus: 'Backlog',
        iosStatus: 'Beta',
        macosStatus: 'Backlog',
        androidStatus: 'Backlog',
    };
    var description = 'Spinner is a visual representation that data is being loaded. It is implemented with a View wrapping an Animated SVG. The View is to ensure that AccessibilityRole works. AccessibilityRole currently does not work on SVGs.';
    return React.createElement(Test_1.Test, { name: "Spinner Test", description: description, sections: spinnerSections, status: status });
};
exports.SpinnerTest = SpinnerTest;
//# sourceMappingURL=SpinnerTest.js.map