From cc67f2f572f3eb3a096cd06d474aa4865b7a2819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Curcio?= Date: Wed, 12 Sep 2018 09:00:38 -0300 Subject: [PATCH] Changes --- src/core/client/ui/components/Tabs/Tab.tsx | 6 +++--- .../client/ui/components/Tabs/TabBar.spec.tsx | 16 ++++++++++++++++ src/core/client/ui/components/Tabs/TabBar.tsx | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 src/core/client/ui/components/Tabs/TabBar.spec.tsx diff --git a/src/core/client/ui/components/Tabs/Tab.tsx b/src/core/client/ui/components/Tabs/Tab.tsx index a0b23c0aa..9afe73023 100644 --- a/src/core/client/ui/components/Tabs/Tab.tsx +++ b/src/core/client/ui/components/Tabs/Tab.tsx @@ -1,5 +1,5 @@ import cn from "classnames"; -import React from "react"; +import React, { ReactNode } from "react"; import { withStyles } from "talk-ui/hocs"; import * as styles from "./Tab.css"; @@ -19,11 +19,11 @@ export interface TabProps { /** * Active status */ - active: boolean; + active?: boolean; /** * Color style variant */ - color: "primary" | "secondary"; + color?: "primary" | "secondary"; /** * Action taken on tab click */ diff --git a/src/core/client/ui/components/Tabs/TabBar.spec.tsx b/src/core/client/ui/components/Tabs/TabBar.spec.tsx new file mode 100644 index 000000000..ef12f60d3 --- /dev/null +++ b/src/core/client/ui/components/Tabs/TabBar.spec.tsx @@ -0,0 +1,16 @@ +import React from "react"; +import TestRenderer from "react-test-renderer"; + +import Tab from "./Tab"; +import TabBar from "./TabBar"; + +it("renders correctly", () => { + const renderer = TestRenderer.create( + + One + Two + Three + + ); + expect(renderer.toJSON()).toMatchSnapshot(); +}); diff --git a/src/core/client/ui/components/Tabs/TabBar.tsx b/src/core/client/ui/components/Tabs/TabBar.tsx index f614cce4f..88c77b95b 100644 --- a/src/core/client/ui/components/Tabs/TabBar.tsx +++ b/src/core/client/ui/components/Tabs/TabBar.tsx @@ -15,7 +15,7 @@ export interface TabBarProps { /** * Color style variant */ - color: "primary" | "secondary"; + color?: "primary" | "secondary"; /** * Active tab id/name */