@lad-tech/mobydick-core
Version:
React Native components library focused on usability, accessibility and developer experience
28 lines (25 loc) • 630 B
text/typescript
import {Dimensions, Platform} from 'react-native';
import rem from '../rem';
describe('rem', () => {
it('should correct ios', () => {
Platform.OS = 'ios';
const res = rem(10);
expect(res).toEqual(15);
});
it('should correct android', () => {
Platform.OS = 'android';
const res = rem(10);
expect(res).toEqual(15);
});
it('should correct horizontal', () => {
Platform.OS = 'android';
jest.spyOn(Dimensions, 'get').mockImplementation(() => ({
width: 818,
height: 414,
scale: 1,
fontScale: 1,
}));
const res = rem(10);
expect(res).toEqual(11);
});
});