2015-10-05 09:15:09 -07:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-16 18:24:55 -08: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 06:14:11 -07:00
|
|
|
*
|
2018-05-11 12:43:49 -07:00
|
|
|
* @format
|
2017-11-02 06:14:11 -07:00
|
|
|
* @emails oncall+javascript_foundation
|
2015-10-05 09:15:09 -07:00
|
|
|
*/
|
2018-05-11 12:43:49 -07:00
|
|
|
|
2015-10-05 09:15:09 -07:00
|
|
|
'use strict';
|
|
|
|
|
2017-06-13 15:01:42 -07:00
|
|
|
jest.dontMock('../getAssetDestPathIOS');
|
2015-10-05 09:15:09 -07: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');
|
|
|
|
});
|
|
|
|
});
|