react-native/Examples/Movies/__tests__/getImageSource-test.js
Christoph Pojer d363b1f2e2 Update Jest APIs on fbsource
Reviewed By: javache

Differential Revision: D3229435

fb-gh-sync-id: b0e252d69e1f399a946fca6e98ef62ff44c2ef9c
fbshipit-source-id: b0e252d69e1f399a946fca6e98ef62ff44c2ef9c
2016-04-27 19:16:32 -07:00

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'
);
});
});