Skip to content

Commit 1314791

Browse files
SinzoLnovlan1
andauthored
test(count-down): add count-down test (#697) (#781)
* test(count-down): add count-down test (#697) * test(CountDown): 修复报错信息 (#697) * test: update test case name --------- Co-authored-by: novlan1 <[email protected]>
1 parent ac1d4ed commit 1314791

File tree

5 files changed

+409
-11
lines changed

5 files changed

+409
-11
lines changed

site/test-coverage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
colorPicker: { statements: '3.03%', branches: '0%', functions: '0%', lines: '3.03%' },
1313
common: { statements: '82.75%', branches: '66.66%', functions: '83.33%', lines: '92%' },
1414
configProvider: { statements: '54.54%', branches: '0%', functions: '0%', lines: '54.54%' },
15-
countDown: { statements: '22.22%', branches: '0%', functions: '0%', lines: '25%' },
15+
countDown: { statements: '100%', branches: '90%', functions: '100%', lines: '100%' },
1616
dateTimePicker: { statements: '5.67%', branches: '0%', functions: '0%', lines: '6.06%' },
1717
dialog: { statements: '4.3%', branches: '0%', functions: '0%', lines: '4.49%' },
1818
divider: { statements: '100%', branches: '100%', functions: '100%', lines: '100%' },

src/count-down/CountDown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const CountDown = forwardRef<CountDownRef, CountDownProps>((props, ref) => {
3737

3838
const countDownClass = usePrefixClass('count-down');
3939

40-
const { timeText, timeList, start, reset, pause } = useCountDown({
40+
const { timeText, timeList, timeData, start, reset, pause } = useCountDown({
4141
autoStart,
4242
millisecond,
4343
time,
@@ -59,7 +59,7 @@ const CountDown = forwardRef<CountDownRef, CountDownProps>((props, ref) => {
5959

6060
const renderContent = () => {
6161
if (content !== 'default') {
62-
return parseTNode(content || children);
62+
return parseTNode(content || children, timeData);
6363
}
6464

6565
return timeList.map(({ digit, unit, match }) => (

0 commit comments

Comments
 (0)