test: test the new message, update the snapshot

This commit is contained in:
0x29a
2023-03-01 17:10:47 +01:00
parent 5b543ea93e
commit 897c440f26
2 changed files with 18 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
exports[`DurationWidget render snapshots: renders as expected with default props 1`] = `
<injectIntl(ShimmedIntlComponent)
fontSize="x-small"
subtitle="Total: 00:00:00"
subtitle="Custom: 00:00:00"
title="Duration"
>
<FormattedMessage
@@ -52,9 +52,13 @@ exports[`DurationWidget render snapshots: renders as expected with default props
</Form.Group>
</Form.Row>
<div
className="mt-4"
className="mt-4 mx-2 text-right"
>
Total: 00:00:00
<span
className="p-2 total-label rounded"
>
Total: 00:00:00
</span>
</div>
</injectIntl(ShimmedIntlComponent)>
`;

View File

@@ -120,10 +120,20 @@ describe('Video Settings DurationWidget hooks', () => {
startTime: '00:00:00',
stopTime: '00:00:10',
},
subtitle: true,
subtitle: false,
intl,
})).toEqual(messages.total);
});
describe('returns custom message when at least stopTime is set and subtitle is true', () => {
expect(testMethod.getTotalLabel({
durationString: {
startTime: '00:00:00',
stopTime: '00:00:10',
},
subtitle: true,
intl,
})).toEqual(messages.custom);
});
});
});
});