2015-10-05 16:15:09 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2017-11-02 13:14:11 +00:00
|
|
|
*
|
2018-05-11 19:43:49 +00:00
|
|
|
* @format
|
2017-11-02 13:14:11 +00:00
|
|
|
* @emails oncall+javascript_foundation
|
2015-10-05 16:15:09 +00:00
|
|
|
*/
|
2018-05-11 19:43:49 +00:00
|
|
|
|
2015-10-05 16:15:09 +00:00
|
|
|
'use strict';
|
|
|
|
|
2017-06-13 22:01:42 +00:00
|
|
|
jest.dontMock('../getAssetDestPathIOS');
|
2015-10-05 16:15:09 +00:00
|
|
|
|
|
|
|
const getAssetDestPathIOS = require('../getAssetDestPathIOS');
|
|
|
|
|
|
|
|
describe('getAssetDestPathIOS', () => {
|
|
|
|
it('should build correct path', () => {
|
|
|
|
const asset = {
|
|
|
|
name: 'icon',
|
|
|
|
type: 'png',
|
|
|
|
httpServerLocation: '/assets/test',
|
|
|
|
};
|
|
|
|
|
|
|
|
expect(getAssetDestPathIOS(asset, 1)).toBe('assets/test/icon.png');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should consider scale', () => {
|
|
|
|
const asset = {
|
|
|
|
name: 'icon',
|
|
|
|
type: 'png',
|
|
|
|
httpServerLocation: '/assets/test',
|
|
|
|
};
|
|
|
|
|
|
|
|
expect(getAssetDestPathIOS(asset, 2)).toBe('assets/test/icon@2x.png');
|
|
|
|
expect(getAssetDestPathIOS(asset, 3)).toBe('assets/test/icon@3x.png');
|
|
|
|
});
|
|
|
|
});
|