Added missing tests for slider components

This commit is contained in:
Daniel Earwicker
2017-09-17 12:48:04 +01:00
parent 51f7a4f4e1
commit 438ffdbebb
3 changed files with 50 additions and 13 deletions

View File

@@ -13,7 +13,7 @@ export declare class Slider extends Component<SliderProps, SliderState> {
export interface SliderProps extends React.HTMLAttributes<HTMLDivElement>, 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<TwoHandleSliderProps, Two
export interface TwoHandleSliderProps extends React.HTMLAttributes<HTMLDivElement>, 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<SliderHandle>;
export interface SliderHandle extends React.HTMLAttributes<HTMLSpanElement> {
export declare const SliderHandle: React.StatelessComponent<SliderHandleProps>;
export interface SliderHandleProps extends React.HTMLAttributes<HTMLSpanElement> {
}
export interface SliderFillProps {
className?: string;

View File

@@ -1,9 +1,3 @@
// Type definitions for react-foundation 0.9
// Project: https://github.com/digiaonline/react-foundation
// Definitions by: Daniel Earwicker <https://github.com/danielearwicker>
// 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';

View File

@@ -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}
/>
<Slider/>
<Slider
style={{position: "absolute"}}
className="foo"
onClick = {(e) => e.pageX}
/>
<Slider
initialStart={2}
fill={{}}
handle={{}}
isVertical={true}
isDisabled={false}
/>
<TwoHandleSlider/>
<TwoHandleSlider
style={{position: "absolute"}}
className="foo"
onClick = {(e) => e.pageX}
/>
<TwoHandleSlider
initialStart={3}
initialEnd={4}
minHandle={{}}
maxHandle={{}}
fill={{}}
isVertical={true}
isDisabled={false}
/>
<SliderHandle/>
<SliderHandle
style={{position: "absolute"}}
className="foo"
onClick = {(e) => e.pageX}
/>
<SliderFill/>
<SliderFill className="foo" />
</div>
);
}
}
// <Slider/> <TwoHandleSlider/> <SliderHandle/> <SliderFill/> -- missing from index?