-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 0.3 features and improvements (#34)
- Loading branch information
Showing
9 changed files
with
88 additions
and
26 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 |
---|---|---|
|
@@ -68,7 +68,14 @@ describe('ScaledSheet', () => { | |
height: '34@ms', | ||
marginRight: '[email protected]', | ||
marginLeft: '[email protected]', | ||
marginBottom: '[email protected]', | ||
marginTop: '-10@s', | ||
}, | ||
round: { | ||
top: '11.3@sr', | ||
bottom: '22.75@vsr', | ||
left: '35.1@msr', | ||
right: '[email protected]' | ||
} | ||
}; | ||
|
||
|
@@ -87,7 +94,14 @@ describe('ScaledSheet', () => { | |
height: moderateScale(34), | ||
marginRight: moderateScale(0.5, 0.9), | ||
marginLeft: moderateScale(-0.5, 0.9), | ||
marginBottom: moderateScale(0.532, 0.9), | ||
marginTop: scale(-10), | ||
}, | ||
round: { | ||
top: Math.round(scale(11.3)), | ||
bottom: Math.round(verticalScale(22.75)), | ||
left: Math.round(moderateScale(35.1)), | ||
right: Math.round(moderateScale(-20.19, 0.3)) | ||
} | ||
}; | ||
|
||
|
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,25 @@ | ||
jest.mock('react-native'); | ||
import { s, vs, ms } from '..'; | ||
|
||
describe('scaling-utils', () => { | ||
test('scale returns the expected result based on mocked Dimensions', () => { | ||
expect(s(2.5)).toBe(5); | ||
expect(s(100)).toBe(200); | ||
expect(s(200)).toBe(400); | ||
}); | ||
|
||
test('verticalScale returns the expected result based on mocked Dimensions', () => { | ||
expect(vs(5)).toBe(7.5); | ||
expect(vs(100)).toBe(150); | ||
expect(vs(200)).toBe(300); | ||
}); | ||
|
||
test('moderateScale returns the expected result based on mocked Dimensions', () => { | ||
expect(ms(100)).toBe(150); | ||
expect(ms(100, 0.1)).toBe(110); | ||
expect(ms(100, 0.3)).toBe(130); | ||
expect(ms(100, 0.6)).toBe(160); | ||
expect(ms(100, 0.9)).toBe(190); | ||
expect(ms(100, 2)).toBe(300); | ||
}); | ||
}) |
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
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
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