Skip to content

Commit 488e741

Browse files
ksvitkovskygaearon
authored andcommitted
Use only public API in CSSProperty-test (#10429)
* Use only public API in CSSProperty-test * Move test to ReactDOMServerIntegration * Add explanation
1 parent 2999811 commit 488e741

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

src/renderers/dom/shared/__tests__/CSSProperty-test.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,43 @@ describe('ReactDOMServerIntegration', () => {
791791
expect(e.style.width).toBe('');
792792
expect(e.hasAttribute('style')).toBe(false);
793793
});
794+
795+
itRenders('unitless-number rules with prefixes', async render => {
796+
const {style} = await render(
797+
<div
798+
style={{
799+
lineClamp: 10,
800+
WebkitLineClamp: 10,
801+
MozFlexGrow: 10,
802+
msFlexGrow: 10,
803+
msGridRow: 10,
804+
msGridRowEnd: 10,
805+
msGridRowSpan: 10,
806+
msGridRowStart: 10,
807+
msGridColumn: 10,
808+
msGridColumnEnd: 10,
809+
msGridColumnSpan: 10,
810+
msGridColumnStart: 10,
811+
}}
812+
/>,
813+
);
814+
815+
expect(style.lineClamp).toBe('10');
816+
expect(style.WebkitLineClamp).toBe('10');
817+
expect(style.MozFlexGrow).toBe('10');
818+
// jsdom is inconsistent in the style property name
819+
// it uses on the client and when processing server markup.
820+
// But it should be there either way.
821+
expect(style.MsFlexGrow || style.msFlexGrow).toBe('10');
822+
expect(style.MsGridRow || style.msGridRow).toBe('10');
823+
expect(style.MsGridRowEnd || style.msGridRowEnd).toBe('10');
824+
expect(style.MsGridRowSpan || style.msGridRowSpan).toBe('10');
825+
expect(style.MsGridRowStart || style.msGridRowStart).toBe('10');
826+
expect(style.MsGridColumn || style.msGridColumn).toBe('10');
827+
expect(style.MsGridColumnEnd || style.msGridColumnEnd).toBe('10');
828+
expect(style.MsGridColumnSpan || style.msGridColumnSpan).toBe('10');
829+
expect(style.MsGridColumnStart || style.msGridColumnStart).toBe('10');
830+
});
794831
});
795832

796833
describe('aria attributes', function() {

0 commit comments

Comments
 (0)