test: add additional tests for convertInlineStyleToMap

This test if the code leaved custom css properties be.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2024-11-01 15:40:23 +01:00 committed by Erik Michelson
parent 82e7f439c8
commit 6d0d7c31ff

View file

@ -26,4 +26,16 @@ describe('convertInlineStyleToMap', () => {
expect(Object.keys(styleObject)).toHaveLength(1) expect(Object.keys(styleObject)).toHaveLength(1)
expect(styleObject.content).toEqual('\\;') expect(styleObject.content).toEqual('\\;')
}) })
it('should respect css custom properties', () => {
const styleObject = convertInlineStyleToMap('--test: okay;')
expect(Object.keys(styleObject)).toHaveLength(1)
expect(styleObject['--test']).toEqual('okay')
})
it('should transform -ms css properties', () => {
const styleObject = convertInlineStyleToMap(
'-ms-overflow-style: ms-autohiding-scrollbar'
)
expect(Object.keys(styleObject)).toHaveLength(1)
expect(styleObject['msOverflowStyle']).toEqual('ms-autohiding-scrollbar')
})
}) })