UNPKG

@netdata/netdata-ui

Version:

netdata UI kit

36 lines 1.56 kB
import useStyleTabs from "./use-styles-tab"; import { renderHookWithProviders } from "testUtilities"; import { DefaultTheme } from "../../../theme/index"; describe("useStyleTabs", function () { it("should return the correct styles when tab is not active", function () { var _renderHookWithProvid = renderHookWithProviders(function () { return useStyleTabs({ active: false }); }), result = _renderHookWithProvid.result; expect(result.current.rootStyles.background).toBe("topBarBg"); expect(result.current.rootStyles.sx.borderTop).toBe("2px solid transparent"); }); it("should return the correct styles when tab active", function () { var expectedBorderTopColor = DefaultTheme.colors.primary; var _renderHookWithProvid2 = renderHookWithProviders(function () { return useStyleTabs({ active: true }); }), result = _renderHookWithProvid2.result; expect(result.current.rootStyles.background).toBe("mainBackground"); expect(result.current.rootStyles.sx.borderTop).toBe("2px solid " + expectedBorderTopColor); }); it("should return borderLeft when {showBorderLeft} is true", function () { var expectedBorderTopColor = DefaultTheme.colors.border; var _renderHookWithProvid3 = renderHookWithProviders(function () { return useStyleTabs({ showBorderLeft: true }); }), result = _renderHookWithProvid3.result; expect(result.current.rootStyles.sx.borderLeft).toBe("1px solid " + expectedBorderTopColor); }); });