Add failing test for style resolving behavior

Less specific shorthand style properties are being applied instead of the more
specific styles if there is another element also with one of the more specific
styles. This is due to the common styles being pulled out as class names for
de-duplication.

Ref #2007
Close #2010
This commit is contained in:
Chris Green
2021-05-04 20:57:36 +01:00
committed by Nicolas Gallagher
parent 04fbf5e5ce
commit d05fa342d0
@@ -77,6 +77,16 @@ describe('StyleSheet/createStyleResolver', () => {
expect(styleResolver.resolve({ pointerEvents: 'box-none' })).toMatchSnapshot();
});
test.skip('long form style properties take precedence over shorthand properties', () => {
const registeredStyle1 = ReactNativePropRegistry.register({ paddingHorizontal: '40px' });
const inlineStyle1 = { padding: '8px', paddingHorizontal: '40px' };
expect(styleResolver.resolve([registeredStyle1, inlineStyle1])).toMatchSnapshot();
const registeredStyle2 = ReactNativePropRegistry.register({ marginVertical: '40px' });
const inlineStyle2 = { margin: '8px', marginVertical: '40px' };
expect(styleResolver.resolve([registeredStyle2, inlineStyle2])).toMatchSnapshot();
});
describe('sheet', () => {
beforeEach(() => {
ExecutionEnvironment.canUseDOM = false;