From 438ffdbebb99d70c97fb4097c35375d5faff5324 Mon Sep 17 00:00:00 2001 From: Daniel Earwicker Date: Sun, 17 Sep 2017 12:48:04 +0100 Subject: [PATCH] Added missing tests for slider components --- types/react-foundation/components/slider.d.ts | 10 ++-- types/react-foundation/index.d.ts | 6 --- .../test/react-foundation-tests.tsx | 47 ++++++++++++++++++- 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/types/react-foundation/components/slider.d.ts b/types/react-foundation/components/slider.d.ts index 6512cf9e5b..b5b414ba23 100644 --- a/types/react-foundation/components/slider.d.ts +++ b/types/react-foundation/components/slider.d.ts @@ -13,7 +13,7 @@ export declare class Slider extends Component { export interface SliderProps extends React.HTMLAttributes, SliderCommonProps { initialStart?: number; fill?: SliderFillProps; - handle?: React.CSSProperties; + handle?: SliderHandleProps; } export interface SliderState { value: number; @@ -30,8 +30,8 @@ export declare class TwoHandleSlider extends Component, SliderCommonProps { initialStart?: number; initialEnd?: number; - minHandle?: React.CSSProperties; - maxHandle?: React.CSSProperties; + minHandle?: SliderHandleProps; + maxHandle?: SliderHandleProps; fill?: SliderFillProps; } export interface TwoHandleSliderState { @@ -44,8 +44,8 @@ export interface TwoHandleSliderState { * @param {Object} props * @returns {XML} */ -export declare const SliderHandle: React.StatelessComponent; -export interface SliderHandle extends React.HTMLAttributes { +export declare const SliderHandle: React.StatelessComponent; +export interface SliderHandleProps extends React.HTMLAttributes { } export interface SliderFillProps { className?: string; diff --git a/types/react-foundation/index.d.ts b/types/react-foundation/index.d.ts index 9c57984200..6f646e76d1 100644 --- a/types/react-foundation/index.d.ts +++ b/types/react-foundation/index.d.ts @@ -1,9 +1,3 @@ -// Type definitions for react-foundation 0.9 -// Project: https://github.com/digiaonline/react-foundation -// Definitions by: Daniel Earwicker -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 - export { Accordion, AccordionItem, AccordionTitle, AccordionContent } from './components/accordion'; export { Badge } from './components/badge'; export { Breadcrumbs, BreadcrumbItem } from './components/breadcrumbs'; diff --git a/types/react-foundation/test/react-foundation-tests.tsx b/types/react-foundation/test/react-foundation-tests.tsx index 6a79ba8b0e..6da8692f9c 100644 --- a/types/react-foundation/test/react-foundation-tests.tsx +++ b/types/react-foundation/test/react-foundation-tests.tsx @@ -17,7 +17,6 @@ import { Progress, ProgressMeter, ProgressMeterWithText, ProgressMeterText, NativeProgress, ResponsiveNavigation, TitleBar, MenuIcon, TitleBarTitle, Reveal, - // Slider, TwoHandleSlider, SliderHandle, SliderFill, -- missing from index? Switch, SwitchInput, SwitchPaddle, SwitchActive, SwitchInactive, Tabs, TabItem, TabsContent, TabPanel, Thumbnail, ThumbnailLink, @@ -25,6 +24,10 @@ import { GridContainer, Grid, Cell } from 'react-foundation'; +import { // missing from index? + Slider, TwoHandleSlider, SliderHandle, SliderFill +} from 'react-foundation/components/slider' + import { HorizontalAlignments, VerticalAlignments, ExtendedBreakpoints, SpaceControls, BadgeColors, ButtonGroupColors, ButtonGroupSizes, Breakpoints, @@ -1301,9 +1304,49 @@ export class ReactFoundationTests extends React.Component { offsetOnMedium={6} offsetOnLarge={6} /> + + + e.pageX} + /> + + + + e.pageX} + /> + + + + e.pageX} + /> + + + ); } } -// -- missing from index? +