{"size": 894, "ext": "js", "max_stars_repo_path": "typings/components/tabBar/__tests__/index.spec.js", "max_stars_repo_name": "rghorbani/react-native-ui-lib", "max_stars_repo_stars_event_min_datetime": "2018-10-15T11:43:03.000Z", "max_stars_repo_stars_event_max_datetime": "2018-10-15T11:43:03.000Z", "max_issues_repo_path": "typings/components/tabBar/__tests__/index.spec.js", "max_issues_repo_name": "rghorbani/react-native-ui-lib", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "typings/components/tabBar/__tests__/index.spec.js", "max_forks_repo_name": "rghorbani/react-native-ui-lib", "max_forks_repo_forks_event_min_datetime": "2018-12-06T23:19:28.000Z", "max_forks_repo_forks_event_max_datetime": "2018-12-06T23:19:28.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 31.9285714286, "max_line_length": 60, "alphanum_fraction": 0.4496644295}
import TabBar from "../index";
describe("TabBar", () => {
    describe("calcIndicatorWidth", () => {
        it("should equale 25%", () => {
            const uut = new TabBar({});
            uut.state = {
                widths: [80, 80, 80, 80],
                selectedIndex: 1
            };
            uut.childrenCount = 4;
            uut.contentWidth = 320;
            jest.spyOn(uut, "calcIndicatorWidth");
            expect(uut.calcIndicatorWidth()).toEqual("25%");
        });
        it("should equale 50%", () => {
            const uut = new TabBar({});
            uut.state = {
                widths: [150, 150, 300],
                selectedIndex: 2
            };
            uut.childrenCount = 2;
            uut.contentWidth = 600;
            jest.spyOn(uut, "calcIndicatorWidth");
            expect(uut.calcIndicatorWidth()).toEqual("50%");
        });
    });
});
