Files
mattermost-mobile/app/components/progressive_image/progressive_image.test.js
Elias Nahum 10572d17ad MM-26817 Upgrade to RN 0.63 (#4566)
* Upgrade to RN 0.63

* Bump to RN 0.63.1

* Fix RN patch

* Use JSC Intl version

* Update android/app/build.gradle

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* Fix Android external storage permission

* Fix emoji imageUrl when no server url is present

* Patch react-native-image-picker

* Allow to post attachment only messages

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-08-14 14:05:23 -04:00

60 lines
1.9 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {shallow} from 'enzyme';
import Preferences from '@mm-redux/constants/preferences';
import ProgressiveImage from './progressive_image';
jest.useFakeTimers();
describe('ProgressiveImage', () => {
test('should match snapshot for Image', () => {
const baseProps = {
isBackgroundImage: false,
imageUri: 'https://images.com/image.png',
onError: jest.fn(),
resizeMethod: 'auto',
resizeMode: 'contain',
theme: Preferences.THEMES.default,
tintDefaultSource: false,
defaultSource: null,
};
const wrapper = shallow(<ProgressiveImage {...baseProps}/>);
expect(wrapper.getElement()).toMatchSnapshot();
});
test('should match snapshot for Default Image', () => {
const baseProps = {
isBackgroundImage: false,
defaultSource: 'https://images.com/image.png',
onError: jest.fn(),
resizeMethod: 'auto',
resizeMode: 'contain',
theme: Preferences.THEMES.default,
tintDefaultSource: false,
};
const wrapper = shallow(<ProgressiveImage {...baseProps}/>);
expect(wrapper.getElement()).toMatchSnapshot();
});
test('should match snapshot for BackgroundImage', () => {
const baseProps = {
isBackgroundImage: true,
imageUri: 'https://images.com/image.png',
onError: jest.fn(),
resizeMethod: 'auto',
resizeMode: 'contain',
theme: Preferences.THEMES.default,
tintDefaultSource: false,
defaultSource: null,
};
const wrapper = shallow(<ProgressiveImage {...baseProps}/>);
expect(wrapper.getElement()).toMatchSnapshot();
});
});