Skip to content

Commit d05fa34

Browse files
chrisgreen1993necolas
authored andcommitted
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
1 parent 04fbf5e commit d05fa34

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/react-native-web/src/exports/StyleSheet/__tests__/createStyleResolver-test.js

+10
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ describe('StyleSheet/createStyleResolver', () => {
7777
expect(styleResolver.resolve({ pointerEvents: 'box-none' })).toMatchSnapshot();
7878
});
7979

80+
test.skip('long form style properties take precedence over shorthand properties', () => {
81+
const registeredStyle1 = ReactNativePropRegistry.register({ paddingHorizontal: '40px' });
82+
const inlineStyle1 = { padding: '8px', paddingHorizontal: '40px' };
83+
expect(styleResolver.resolve([registeredStyle1, inlineStyle1])).toMatchSnapshot();
84+
85+
const registeredStyle2 = ReactNativePropRegistry.register({ marginVertical: '40px' });
86+
const inlineStyle2 = { margin: '8px', marginVertical: '40px' };
87+
expect(styleResolver.resolve([registeredStyle2, inlineStyle2])).toMatchSnapshot();
88+
});
89+
8090
describe('sheet', () => {
8191
beforeEach(() => {
8292
ExecutionEnvironment.canUseDOM = false;

0 commit comments

Comments
 (0)