From d2660da2eb17fc01cb520c4c48d72aa783238f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vidmantas=20=C5=BDemaitis?= Date: Thu, 18 Oct 2018 19:12:28 +0300 Subject: [PATCH] Text alignment typo fix (#47) * Text alignment typo fix Text alignment does not work. Wrong key is used. Draft js uses `textAlignment` https://draftjs.org/docs/advanced-topics-text-direction#text-alignment * changing to dot notation * updated tests * fixed linter error --- sample/__tests__/components/DraftJsText.test.js | 6 +++--- src/components/DraftJsText.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sample/__tests__/components/DraftJsText.test.js b/sample/__tests__/components/DraftJsText.test.js index f242183..a809b72 100644 --- a/sample/__tests__/components/DraftJsText.test.js +++ b/sample/__tests__/components/DraftJsText.test.js @@ -76,7 +76,7 @@ it('extends a style with a customStyle from another type', () => { it('renders text-align: left', () => { const text = 'Hello World'; - const data = { 'text-align': 'left' }; + const data = { textAlignment: 'left' }; const tree = renderer.create( { it('renders text-align: right', () => { const text = 'Hello World'; - const data = { 'text-align': 'right' }; + const data = { textAlignment: 'right' }; const tree = renderer.create( { it('renders text-align: center', () => { const text = 'Hello World'; - const data = { 'text-align': 'center' }; + const data = { textAlignment: 'center' }; const tree = renderer.create( { }); const customStyle = props.customStyles ? props.customStyles[props.type] : undefined; - const textAlignStyle = { textAlign: props.data['text-align'] }; + const textAlignStyle = { textAlign: props.data.textAlignment }; return (