-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[enforce-longhand] borderMode config option (#895)
* #830 add borderMode config option to enforce-longhands closes #830 * fix deps * fix action * revert to old action
- Loading branch information
1 parent
f9468b6
commit 9aeea63
Showing
6 changed files
with
396 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
229 changes: 229 additions & 0 deletions
229
packages/fela-enforce-longhands/src/__tests__/__snapshots__/index-test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,229 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`enforceLonghands enhancer should accept a borderMode=directional configuration 1`] = ` | ||
Object { | ||
"animationDelay": 2, | ||
"animationDirection": 2, | ||
"animationDuration": 2, | ||
"animationFillMode": 2, | ||
"animationIterationCount": 2, | ||
"animationName": 2, | ||
"animationPlayState": 2, | ||
"animationTimingFunction": 2, | ||
"backgroundClip": 2, | ||
"backgroundColor": 2, | ||
"backgroundImage": 2, | ||
"backgroundOrigin": 2, | ||
"backgroundPosition": 2, | ||
"backgroundRepeat": 2, | ||
"backgroundSize": 2, | ||
"borderBottom": 3, | ||
"borderBottomColor": 4, | ||
"borderBottomLeftRadius": 2, | ||
"borderBottomRightRadius": 2, | ||
"borderBottomStyle": 4, | ||
"borderBottomWidth": 4, | ||
"borderColor": 2, | ||
"borderImageOutset": 2, | ||
"borderImageRepeat": 2, | ||
"borderImageSlice": 2, | ||
"borderImageSource": 2, | ||
"borderImageWidth": 2, | ||
"borderLeft": 3, | ||
"borderLeftColor": 4, | ||
"borderLeftStyle": 4, | ||
"borderLeftWidth": 4, | ||
"borderRight": 3, | ||
"borderRightColor": 4, | ||
"borderRightStyle": 4, | ||
"borderRightWidth": 4, | ||
"borderStyle": 2, | ||
"borderTop": 3, | ||
"borderTopColor": 4, | ||
"borderTopLeftRadius": 2, | ||
"borderTopRightRadius": 2, | ||
"borderTopStyle": 4, | ||
"borderTopWidth": 4, | ||
"borderWidth": 2, | ||
"columnCount": 2, | ||
"columnWidth": 2, | ||
"flexBasis": 2, | ||
"flexShrink": 2, | ||
"flexWrap": 2, | ||
"listStyleImage": 2, | ||
"listStylePosition": 2, | ||
"listStyleType": 2, | ||
"marginBottom": 2, | ||
"marginLeft": 2, | ||
"marginRight": 2, | ||
"marginTop": 2, | ||
"outlineColor": 2, | ||
"outlineStyle": 2, | ||
"outlineWidth": 2, | ||
"overflowX": 2, | ||
"overflowY": 2, | ||
"paddingBottom": 2, | ||
"paddingLeft": 2, | ||
"paddingRight": 2, | ||
"paddingTop": 2, | ||
"textDecorationColor": 2, | ||
"textDecorationLine": 2, | ||
"textDecorationStyle": 2, | ||
"transitionDelay": 2, | ||
"transitionDuration": 2, | ||
"transitionProperty": 2, | ||
"transitionTimingFunction": 2, | ||
} | ||
`; | ||
|
||
exports[`enforceLonghands enhancer should accept a borderMode=longhand configuration 1`] = ` | ||
Object { | ||
"animationDelay": 2, | ||
"animationDirection": 2, | ||
"animationDuration": 2, | ||
"animationFillMode": 2, | ||
"animationIterationCount": 2, | ||
"animationName": 2, | ||
"animationPlayState": 2, | ||
"animationTimingFunction": 2, | ||
"backgroundClip": 2, | ||
"backgroundColor": 2, | ||
"backgroundImage": 2, | ||
"backgroundOrigin": 2, | ||
"backgroundPosition": 2, | ||
"backgroundRepeat": 2, | ||
"backgroundSize": 2, | ||
"borderBottom": 2, | ||
"borderBottomColor": 4, | ||
"borderBottomLeftRadius": 2, | ||
"borderBottomRightRadius": 2, | ||
"borderBottomStyle": 4, | ||
"borderBottomWidth": 4, | ||
"borderColor": 3, | ||
"borderImageOutset": 2, | ||
"borderImageRepeat": 2, | ||
"borderImageSlice": 2, | ||
"borderImageSource": 2, | ||
"borderImageWidth": 2, | ||
"borderLeft": 2, | ||
"borderLeftColor": 4, | ||
"borderLeftStyle": 4, | ||
"borderLeftWidth": 4, | ||
"borderRight": 2, | ||
"borderRightColor": 4, | ||
"borderRightStyle": 4, | ||
"borderRightWidth": 4, | ||
"borderStyle": 3, | ||
"borderTop": 2, | ||
"borderTopColor": 4, | ||
"borderTopLeftRadius": 2, | ||
"borderTopRightRadius": 2, | ||
"borderTopStyle": 4, | ||
"borderTopWidth": 4, | ||
"borderWidth": 3, | ||
"columnCount": 2, | ||
"columnWidth": 2, | ||
"flexBasis": 2, | ||
"flexShrink": 2, | ||
"flexWrap": 2, | ||
"listStyleImage": 2, | ||
"listStylePosition": 2, | ||
"listStyleType": 2, | ||
"marginBottom": 2, | ||
"marginLeft": 2, | ||
"marginRight": 2, | ||
"marginTop": 2, | ||
"outlineColor": 2, | ||
"outlineStyle": 2, | ||
"outlineWidth": 2, | ||
"overflowX": 2, | ||
"overflowY": 2, | ||
"paddingBottom": 2, | ||
"paddingLeft": 2, | ||
"paddingRight": 2, | ||
"paddingTop": 2, | ||
"textDecorationColor": 2, | ||
"textDecorationLine": 2, | ||
"textDecorationStyle": 2, | ||
"transitionDelay": 2, | ||
"transitionDuration": 2, | ||
"transitionProperty": 2, | ||
"transitionTimingFunction": 2, | ||
} | ||
`; | ||
|
||
exports[`enforceLonghands enhancer should correctly apply property priority 1`] = ` | ||
Object { | ||
"animationDelay": 2, | ||
"animationDirection": 2, | ||
"animationDuration": 2, | ||
"animationFillMode": 2, | ||
"animationIterationCount": 2, | ||
"animationName": 2, | ||
"animationPlayState": 2, | ||
"animationTimingFunction": 2, | ||
"backgroundClip": 2, | ||
"backgroundColor": 2, | ||
"backgroundImage": 2, | ||
"backgroundOrigin": 2, | ||
"backgroundPosition": 2, | ||
"backgroundRepeat": 2, | ||
"backgroundSize": 2, | ||
"borderBottom": 2, | ||
"borderBottomColor": 3, | ||
"borderBottomLeftRadius": 2, | ||
"borderBottomRightRadius": 2, | ||
"borderBottomStyle": 3, | ||
"borderBottomWidth": 3, | ||
"borderColor": 2, | ||
"borderImageOutset": 2, | ||
"borderImageRepeat": 2, | ||
"borderImageSlice": 2, | ||
"borderImageSource": 2, | ||
"borderImageWidth": 2, | ||
"borderLeft": 2, | ||
"borderLeftColor": 3, | ||
"borderLeftStyle": 3, | ||
"borderLeftWidth": 3, | ||
"borderRight": 2, | ||
"borderRightColor": 3, | ||
"borderRightStyle": 3, | ||
"borderRightWidth": 3, | ||
"borderStyle": 2, | ||
"borderTop": 2, | ||
"borderTopColor": 3, | ||
"borderTopLeftRadius": 2, | ||
"borderTopRightRadius": 2, | ||
"borderTopStyle": 3, | ||
"borderTopWidth": 3, | ||
"borderWidth": 2, | ||
"columnCount": 2, | ||
"columnWidth": 2, | ||
"flexBasis": 2, | ||
"flexShrink": 2, | ||
"flexWrap": 2, | ||
"listStyleImage": 2, | ||
"listStylePosition": 2, | ||
"listStyleType": 2, | ||
"marginBottom": 2, | ||
"marginLeft": 2, | ||
"marginRight": 2, | ||
"marginTop": 2, | ||
"outlineColor": 2, | ||
"outlineStyle": 2, | ||
"outlineWidth": 2, | ||
"overflowX": 2, | ||
"overflowY": 2, | ||
"paddingBottom": 2, | ||
"paddingLeft": 2, | ||
"paddingRight": 2, | ||
"paddingTop": 2, | ||
"textDecorationColor": 2, | ||
"textDecorationLine": 2, | ||
"textDecorationStyle": 2, | ||
"transitionDelay": 2, | ||
"transitionDuration": 2, | ||
"transitionProperty": 2, | ||
"transitionTimingFunction": 2, | ||
} | ||
`; |
37 changes: 37 additions & 0 deletions
37
packages/fela-enforce-longhands/src/__tests__/index-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { createRenderer } from 'fela' | ||
|
||
import enforceLonghands from '../index' | ||
|
||
describe('enforceLonghands enhancer', () => { | ||
it('should correctly apply property priority', () => { | ||
const renderer = createRenderer({ | ||
enhancers: [enforceLonghands()], | ||
}) | ||
|
||
expect(renderer.propertyPriority).toMatchSnapshot() | ||
}) | ||
|
||
it('should accept a borderMode=longhand configuration', () => { | ||
const renderer = createRenderer({ | ||
enhancers: [ | ||
enforceLonghands({ | ||
borderMode: 'longhand', | ||
}), | ||
], | ||
}) | ||
|
||
expect(renderer.propertyPriority).toMatchSnapshot() | ||
}) | ||
|
||
it('should accept a borderMode=directional configuration', () => { | ||
const renderer = createRenderer({ | ||
enhancers: [ | ||
enforceLonghands({ | ||
borderMode: 'directional', | ||
}), | ||
], | ||
}) | ||
|
||
expect(renderer.propertyPriority).toMatchSnapshot() | ||
}) | ||
}) |
Oops, something went wrong.
9aeea63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: