"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SpinnerTest = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const react_native_1 = require("react-native");
const e2e_testing_1 = require("@fluentui-react-native/e2e-testing");
const spinner_1 = require("@fluentui-react-native/spinner");
const stack_1 = require("@fluentui-react-native/stack");
const text_1 = require("@fluentui-react-native/text");
const SpinnerE2ETest_1 = require("./SpinnerE2ETest");
const styles_1 = require("../Common/styles");
const Test_1 = require("../Test");
const BasicSpinnerTest = () => {
    const [status, setStatus] = React.useState('active');
    const [hidesWhenStopped, setHidesWhenStopped] = React.useState(true);
    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: (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 }))));
};
const CustomisedSpinner = spinner_1.Spinner.customize({
    trackColor: 'red',
    size: 'medium',
});
const SpinnerSizeTest = () => {
    const memoizedStyles = React.useMemo(() => ({ ...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" })))));
};
const spinnerSections = [
    {
        name: 'Basic Spinner',
        testID: e2e_testing_1.SPINNER_TESTPAGE,
        component: BasicSpinnerTest,
    },
    {
        name: 'Spinner Size Test',
        component: SpinnerSizeTest,
    },
    {
        name: 'Customized Spinner Test',
        component: () => React.createElement(CustomisedSpinner, null),
    },
    {
        name: 'Spinner for E2E Testing',
        component: () => React.createElement(SpinnerE2ETest_1.E2ETestingSpinner, null),
    },
];
const SpinnerTest = () => {
    const status = {
        win32Status: 'Production',
        uwpStatus: 'Backlog',
        iosStatus: 'Production',
        macosStatus: 'Production',
        androidStatus: 'Production',
    };
    const 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