mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 17:15:54 +00:00
d363b1f2e2
Reviewed By: javache Differential Revision: D3229435 fb-gh-sync-id: b0e252d69e1f399a946fca6e98ef62ff44c2ef9c fbshipit-source-id: b0e252d69e1f399a946fca6e98ef62ff44c2ef9c
37 lines
788 B
JavaScript
37 lines
788 B
JavaScript
/**
|
|
* Copyright 2004-present Facebook. All Rights Reserved.
|
|
*/
|
|
'use strict';
|
|
|
|
jest.unmock('../getImageSource');
|
|
|
|
var getImageSource = require('../getImageSource');
|
|
|
|
describe('getImageSource', () => {
|
|
it('returns null for invalid input', () => {
|
|
expect(getImageSource().uri).toBe(null);
|
|
});
|
|
|
|
it('returns a movie thumbnail', () => {
|
|
var uri = 'https://facebook.com';
|
|
var source = {
|
|
posters: {
|
|
thumbnail: uri,
|
|
},
|
|
};
|
|
expect(getImageSource(source).uri).toBe(uri);
|
|
});
|
|
|
|
it('returns a movie thumbnail with kind', () => {
|
|
var uri = 'https://facebook.com?tmb';
|
|
var source = {
|
|
posters: {
|
|
thumbnail: uri,
|
|
},
|
|
};
|
|
expect(getImageSource(source, 'kind').uri).toBe(
|
|
'https://facebook.com?kind'
|
|
);
|
|
});
|
|
});
|