-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(xstyled): support multiple values in box-shadow, text-shadow (#128)
Fixes #127
- Loading branch information
Showing
2 changed files
with
41 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
import { propGetters } from './propGetters' | ||
|
||
describe('#propGetters', () => { | ||
describe('border-radius', () => { | ||
it('handles several values', () => { | ||
expect(propGetters['border-radius']('10')({})).toBe('10px') | ||
expect(propGetters['font-size']('10')({})).toBe('10px') | ||
expect(propGetters['border-radius']('1 2')({})).toBe('1px 2px') | ||
expect( | ||
propGetters['border-radius']('md')({ theme: { radii: { md: 10 } } }), | ||
).toBe('10px') | ||
expect( | ||
propGetters['border-radius']('md md')({ theme: { radii: { md: 10 } } }), | ||
).toBe('10px 10px') | ||
}) | ||
it('handles simple values', () => { | ||
expect(propGetters['border-radius']('10')({})).toBe('10px') | ||
expect(propGetters['font-size']('10')({})).toBe('10px') | ||
}) | ||
|
||
it('handles multiple dimensions', () => { | ||
expect(propGetters['border-radius']('1 2')({})).toBe('1px 2px') | ||
}) | ||
|
||
it('handles multiple values', () => { | ||
expect( | ||
propGetters['box-shadow']('theme-shadow, 1px 0 0 red')({ | ||
theme: { shadows: { 'theme-shadow': '10px black' } }, | ||
}), | ||
).toBe('10px black,1px 0 0 red') | ||
}) | ||
|
||
it('handles theme', () => { | ||
expect( | ||
propGetters['border-radius']('md')({ theme: { radii: { md: 10 } } }), | ||
).toBe('10px') | ||
expect( | ||
propGetters['border-radius']('md md')({ theme: { radii: { md: 10 } } }), | ||
).toBe('10px 10px') | ||
}) | ||
}) |