Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 1, 2023
1 parent 0d04dbf commit 236f3f4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
7 changes: 1 addition & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,13 +519,8 @@ function createProperties(state, ancestors) {
if (alignValue) {
// Assume style is an object.
const style = /** @type {Style} */ (props.style || (props.style = {}))
const cssField = 'text-align'
style[
state.stylePropertyNameCase === 'css'
? // Note: test this when Solid doesn’t want to merge my upcoming PR.
/* c8 ignore next */
transformStyleToCssCasing(cssField)
: cssField
state.stylePropertyNameCase === 'css' ? 'text-align' : 'textAlign'
] = alignValue
}
}
Expand Down
28 changes: 27 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ test('react specific: `align` to `style`', async function (t) {
)

await t.test(
"should suppoort `tableCellAlignToStyle` w/ `stylePropertyNameCase: 'css'`",
"should support `tableCellAlignToStyle` w/ `stylePropertyNameCase: 'css'`",
async function () {
/** @type {unknown} */
let foundProps
Expand All @@ -652,4 +652,30 @@ test('react specific: `align` to `style`', async function (t) {
})
}
)

await t.test(
"should support `tableCellAlignToStyle` w/ `stylePropertyNameCase: 'dom'`",
async function () {
/** @type {unknown} */
let foundProps

assert.equal(
renderToStaticMarkup(
toJsxRuntime(h('td', {align: 'center'}), {
...production,
jsx(type, props) {
foundProps = props
return production.jsx(type, {})
},
stylePropertyNameCase: 'dom'
})
),
'<td></td>'
)

assert.deepEqual(foundProps, {
style: {textAlign: 'center'}
})
}
)
})

0 comments on commit 236f3f4

Please sign in to comment.