From 9ecb61ea7671d4f19aac7c943fc7db218173181f Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Wed, 25 Jan 2017 15:51:39 +0100 Subject: [PATCH] Add unit tests for some React.CSSProperties --- react/index.d.ts | 3 ++- react/test/cssProperties.tsx | 19 +++++++++++++++++++ react/tsconfig.json | 5 +++-- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 react/test/cssProperties.tsx diff --git a/react/index.d.ts b/react/index.d.ts index e4f3f0a910..35a0fce662 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -1276,8 +1276,9 @@ declare namespace React { /** * Defines how the browser distributes space between and around flex items * along the main-axis of their container. + * See CSS 3 justify-content property https://www.w3.org/TR/css-flexbox-1/#justify-content-property */ - justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around"; + justifyContent?: ExplicitDefaultingCSSKeywords | "flex-start" | "flex-end" | "center" | "space-between" | "space-around"; layoutGrid?: any; diff --git a/react/test/cssProperties.tsx b/react/test/cssProperties.tsx new file mode 100644 index 0000000000..5c99a6391c --- /dev/null +++ b/react/test/cssProperties.tsx @@ -0,0 +1,19 @@ +import * as React from 'react'; + +const initialStyle: React.CSSProperties = { fontWeight: 'initial' }; +const initialStyleTest =
; + +const fontSizeAdjustStyle: React.CSSProperties = { fontSizeAdjust: 'none' }; +const fontSizeAdjustStyleTest =
; + +const fontStretchStyle: React.CSSProperties = { fontStretch: 'condensed' }; +const fontStretchStyleTest =
; + +const fontStyleStyle: React.CSSProperties = { fontStyle: 'italic' }; +const fontStyleStyleTest =
; + +const fontWeightStyle: React.CSSProperties = { fontWeight: 400 }; +const fontWeightStyleTest =
; + +const justifyContentStyle: React.CSSProperties = { justifyContent: 'space-around' }; +const justifyContentStyleTest =
; diff --git a/react/tsconfig.json b/react/tsconfig.json index 18a4fb19fb..d2c4600811 100644 --- a/react/tsconfig.json +++ b/react/tsconfig.json @@ -2,7 +2,8 @@ "files": [ "index.d.ts", "test/index.ts", - "test/tsx.tsx" + "test/tsx.tsx", + "test/cssProperties.tsx" ], "compilerOptions": { "module": "commonjs", @@ -22,4 +23,4 @@ "forceConsistentCasingInFileNames": true, "jsx": "preserve" } -} \ No newline at end of file +}