+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {getTotalLabel({
+ durationString: duration,
+ subtitle: false,
+ intl,
+ })}
+
+
+ );
+};
+
+DurationWidget.propTypes = {
+ // redux
+ duration: PropTypes.objectOf(PropTypes.number).isRequired,
+ updateField: PropTypes.func.isRequired,
+ // injected
+ intl: intlShape.isRequired,
+};
+
+export const mapStateToProps = (state) => ({
+ duration: selectors.video.duration(state),
+});
+
+export const mapDispatchToProps = {
+ updateField: actions.video.updateField,
+};
+
+export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(DurationWidget));
diff --git a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/DurationWidget/index.test.jsx b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/DurationWidget/index.test.jsx
new file mode 100644
index 000000000..ddb9e8df9
--- /dev/null
+++ b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/DurationWidget/index.test.jsx
@@ -0,0 +1,51 @@
+import React from 'react';
+import { shallow } from 'enzyme';
+
+import { actions, selectors } from '../../../../../../data/redux';
+import { formatMessage } from '../../../../../../../testUtils';
+import { DurationWidget, mapStateToProps, mapDispatchToProps } from '.';
+
+jest.mock('../../../../../../data/redux', () => ({
+ actions: {
+ video: {
+ updateField: jest.fn().mockName('actions.video.updateField'),
+ },
+ },
+ selectors: {
+ video: {
+ duration: jest.fn(state => ({ duration: state })),
+ },
+ },
+}));
+
+describe('DurationWidget', () => {
+ const props = {
+ duration: {
+ startTime: '00:00:00',
+ stopTime: '00:00:10',
+ },
+ updateField: jest.fn().mockName('updateField'),
+ // inject
+ intl: { formatMessage },
+ };
+ describe('render', () => {
+ test('snapshots: renders as expected with default props', () => {
+ expect(
+ shallow(