1import AssetSourceResolver from '../AssetSourceResolver';
2
3const fontAsset = {
4  __packager_asset: true,
5  httpServerLocation: '/assets/assets/fonts',
6  fileSystemLocation: '',
7  width: undefined,
8  height: undefined,
9  scales: [1],
10  hash: 'a3b8dba87c8a969c604cab9f4267e628',
11  name: 'Spartan-Bold',
12  type: 'ttf',
13};
14it(`resolves a font asset`, () => {
15  expect(
16    new AssetSourceResolver('http://localhost:8081/foo/bar', null, fontAsset).defaultAsset()
17  ).toEqual({
18    __packager_asset: true,
19    height: undefined,
20    width: undefined,
21    scale: 1,
22    // Important that the path relative to the origin is correct (`foo/bar` is removed).
23    uri: '/assets/assets/fonts/Spartan-Bold.ttf?platform=web&hash=a3b8dba87c8a969c604cab9f4267e628',
24  });
25});
26