提交 bec53f27 编写于 作者: O oasis-cloud

chore: eslint fix

上级 313c3e3d
......@@ -38,7 +38,7 @@ const App = () => {
}
return (
<>
<Cell title="select a single date" desc={ date ? `${date} ${dateWeek}` : 'please choose' } onClick={ openSwitch }></Cell>
<Cell title="select a single date" desc={ date ? `${date} ${dateWeek}` : 'please choose' } onClick={ openSwitch } />
<Calendar
visible={ isVisible }
defaultValue={ date }
......@@ -46,7 +46,7 @@ const App = () => {
endDate="2029-11-11"
onClose={ closeSwitch }
onChoose={ setChooseValue }
></Calendar>
/>
</>
);
};
......@@ -80,7 +80,7 @@ const App = () => {
return (
<>
<Cell title="Select date range" desc={ date1 ? `${date1[0]}to${date1[1]}` : 'please choose' } onClick={ openSwitch1 }></Cell>
<Cell title="Select date range" desc={ date1 ? `${date1[0]}to${date1[1]}` : 'please choose' } onClick={ openSwitch1 } />
<Calendar
visible={ isVisible1 }
defaultValue={ date1 }
......@@ -89,7 +89,7 @@ const App = () => {
endDate="2021-01-08"
onClose={ closeSwitch1 }
onChoose={ setChooseValue1 }
></Calendar>
/>
</>
);
};
......@@ -123,16 +123,16 @@ const App = () => {
return (
<>
<Cell title="select date" desc={ date3 ? `${date3}` : 'please choose' } onClick={ openSwitch3 }></Cell>
<Cell title="select date" desc={ date3 ? `${date3}` : 'please choose' } onClick={ openSwitch3 } />
<Calendar
visible={ isVisible3 }
defaultValue={ date3 }
startDate=""
endDate=""
isAutoBackFill={ true }
isAutoBackFill
onClose={ closeSwitch3 }
onChoose={ setChooseValue3 }
></Calendar>
/>
</>
);
};
......
......@@ -38,7 +38,7 @@ const App = () => {
}
return (
<>
<Cell title="选择单个日期" desc={ date ? `${date} ${dateWeek}` : '请选择' } onClick={ openSwitch }></Cell>
<Cell title="选择单个日期" desc={ date ? `${date} ${dateWeek}` : '请选择' } onClick={ openSwitch } />
<Calendar
visible={ isVisible }
defaultValue={ date }
......@@ -46,7 +46,7 @@ const App = () => {
endDate="2029-11-11"
onClose={ closeSwitch }
onChoose={ setChooseValue }
></Calendar>
/>
</>
);
};
......@@ -80,7 +80,7 @@ const App = () => {
return (
<>
<Cell title="选择日期区间" desc={ date1 ? `${date1[0]}${date1[1]}` : '请选择' } onClick={ openSwitch1 }></Cell>
<Cell title="选择日期区间" desc={ date1 ? `${date1[0]}${date1[1]}` : '请选择' } onClick={ openSwitch1 } />
<Calendar
visible={ isVisible1 }
defaultValue={ date1 }
......@@ -89,7 +89,7 @@ const App = () => {
endDate="2021-01-08"
onClose={ closeSwitch1 }
onChoose={ setChooseValue1 }
></Calendar>
/>
</>
);
};
......@@ -123,16 +123,16 @@ const App = () => {
return (
<>
<Cell title="选择日期" desc={ date3 ? `${date3}` : '请选择' } onClick={ openSwitch3 }></Cell>
<Cell title="选择日期" desc={ date3 ? `${date3}` : '请选择' } onClick={ openSwitch3 } />
<Calendar
visible={ isVisible3 }
defaultValue={ date3 }
startDate=""
endDate=""
isAutoBackFill={ true }
isAutoBackFill
onClose={ closeSwitch3 }
onChoose={ setChooseValue3 }
></Calendar>
/>
</>
);
};
......
......@@ -38,7 +38,7 @@ const App = () => {
}
return (
<>
<Cell title="選擇單個日期" desc={ date ? `${date} ${dateWeek}` : '請選擇' } onClick={ openSwitch }></Cell>
<Cell title="選擇單個日期" desc={ date ? `${date} ${dateWeek}` : '請選擇' } onClick={ openSwitch } />
<Calendar
visible={ isVisible }
defaultValue={ date }
......@@ -46,7 +46,7 @@ const App = () => {
endDate="2029-11-11"
onClose={ closeSwitch }
onChoose={ setChooseValue }
></Calendar>
/>
</>
);
};
......@@ -80,7 +80,7 @@ const App = () => {
return (
<>
<Cell title="選擇日期區間" desc={ date1 ? `${date1[0]}${date1[1]}` : '請選擇' } onClick={ openSwitch1 }></Cell>
<Cell title="選擇日期區間" desc={ date1 ? `${date1[0]}${date1[1]}` : '請選擇' } onClick={ openSwitch1 } />
<Calendar
visible={ isVisible1 }
defaultValue={ date1 }
......@@ -89,7 +89,7 @@ const App = () => {
endDate="2021-01-08"
onClose={ closeSwitch1 }
onChoose={ setChooseValue1 }
></Calendar>
/>
</>
);
};
......@@ -123,16 +123,16 @@ const App = () => {
return (
<>
<Cell title="選擇日期" desc={ date3 ? `${date3}` : '請選擇' } onClick={ openSwitch3 }></Cell>
<Cell title="選擇日期" desc={ date3 ? `${date3}` : '請選擇' } onClick={ openSwitch3 } />
<Calendar
visible={ isVisible3 }
defaultValue={ date3 }
startDate=""
endDate=""
isAutoBackFill={ true }
isAutoBackFill
onClose={ closeSwitch3 }
onChoose={ setChooseValue3 }
></Calendar>
/>
</>
);
};
......
......@@ -54,10 +54,10 @@ const App = () => {
<Cell title="bottom pop" isLink onClick={() => { setShowBottom(true) }}/>
<Cell title="pop up left" isLink onClick={() => { setShowLeft(true) }}/>
<Cell title="pop up right" isLink onClick={() => { setShowRight(true) }}/>
<Popup visible={ showTop } style={{ height: '20%' }} position="top" onClose={ () => { setShowTop(false) } }></Popup>
<Popup visible={ showBottom } style={{ height: '20%' }} position="bottom" onClose={ () => { setShowBottom(false) } }></Popup>
<Popup visible={ showLeft } style={{ width: '20%', height: '100%' }} position="left" onClose={ () => { setShowLeft(false) } }></Popup>
<Popup visible={ showRight } style={{ width: '20%', height: '100%' }} position="right" onClose={ () => { setShowRight(false) } }></Popup>
<Popup visible={ showTop } style={{ height: '20%' }} position="top" onClose={ () => { setShowTop(false) } } />
<Popup visible={ showBottom } style={{ height: '20%' }} position="bottom" onClose={ () => { setShowBottom(false) } } />
<Popup visible={ showLeft } style={{ width: '20%', height: '100%' }} position="left" onClose={ () => { setShowLeft(false) } } />
<Popup visible={ showRight } style={{ width: '20%', height: '100%' }} position="right" onClose={ () => { setShowRight(false) } } />
</>
);
};
......@@ -83,9 +83,9 @@ const App = () => {
<Cell title="close icon" isLink onClick={() => { setShowIcon(true) }}/>
<Cell title="Icon position" isLink onClick={() => { setShowIconPosition(true) }}/>
<Cell title="custom icon" isLink onClick={() => { setShowIconDefine(true) }}/>
<Popup closeable visible={ showIcon } style={{ height: '20%' }} position="bottom" onClose={ () => { setShowIcon(false) } }></Popup>
<Popup closeable visible={ showIconPosition } style={{ height: '20%' }} closeIconPosition="top-left" position="bottom" onClose={ () => { setShowIconPosition(false) } }></Popup>
<Popup closeable visible={ showIconDefine } style={{ height: '20%' }} closeIcon="heart" position="bottom" onClose={ () => { setShowIconDefine(false) } }></Popup>
<Popup closeable visible={ showIcon } style={{ height: '20%' }} position="bottom" onClose={ () => { setShowIcon(false) } } />
<Popup closeable visible={ showIconPosition } style={{ height: '20%' }} closeIconPosition="top-left" position="bottom" onClose={ () => { setShowIconPosition(false) } } />
<Popup closeable visible={ showIconDefine } style={{ height: '20%' }} closeIcon="heart" position="bottom" onClose={ () => { setShowIconDefine(false) } } />
</>
);
};
......@@ -108,7 +108,7 @@ const App = () => {
return (
<>
<Cell title="Rounded popup" isLink onClick={() => { setShowBottomRound(true) }}/>
<Popup closeable visible={ showBottomRound } style={{ height: '20%' }} position="bottom" round onClose={ () => { setShowBottomRound(false) } }></Popup>
<Popup closeable visible={ showBottomRound } style={{ height: '20%' }} position="bottom" round onClose={ () => { setShowBottomRound(false) } } />
</>
);
};
......
......@@ -54,10 +54,10 @@ const App = () => {
<Cell title="底部弹出" isLink onClick={() => { setShowBottom(true) }}/>
<Cell title="左侧弹出" isLink onClick={() => { setShowLeft(true) }}/>
<Cell title="右侧弹出" isLink onClick={() => { setShowRight(true) }}/>
<Popup visible={ showTop } style={{ height: '20%' }} position="top" onClose={ () => { setShowTop(false) } }></Popup>
<Popup visible={ showBottom } style={{ height: '20%' }} position="bottom" onClose={ () => { setShowBottom(false) } }></Popup>
<Popup visible={ showLeft } style={{ width: '20%', height: '100%' }} position="left" onClose={ () => { setShowLeft(false) } }></Popup>
<Popup visible={ showRight } style={{ width: '20%', height: '100%' }} position="right" onClose={ () => { setShowRight(false) } }></Popup>
<Popup visible={ showTop } style={{ height: '20%' }} position="top" onClose={ () => { setShowTop(false) } } />
<Popup visible={ showBottom } style={{ height: '20%' }} position="bottom" onClose={ () => { setShowBottom(false) } } />
<Popup visible={ showLeft } style={{ width: '20%', height: '100%' }} position="left" onClose={ () => { setShowLeft(false) } } />
<Popup visible={ showRight } style={{ width: '20%', height: '100%' }} position="right" onClose={ () => { setShowRight(false) } } />
</>
);
};
......@@ -83,9 +83,9 @@ const App = () => {
<Cell title="关闭图标" isLink onClick={() => { setShowIcon(true) }}/>
<Cell title="图标位置" isLink onClick={() => { setShowIconPosition(true) }}/>
<Cell title="自定义图标" isLink onClick={() => { setShowIconDefine(true) }}/>
<Popup closeable visible={ showIcon } style={{ height: '20%' }} position="bottom" onClose={ () => { setShowIcon(false) } }></Popup>
<Popup closeable visible={ showIconPosition } style={{ height: '20%' }} closeIconPosition="top-left" position="bottom" onClose={ () => { setShowIconPosition(false) } }></Popup>
<Popup closeable visible={ showIconDefine } style={{ height: '20%' }} closeIcon="heart" position="bottom" onClose={ () => { setShowIconDefine(false) } }></Popup>
<Popup closeable visible={ showIcon } style={{ height: '20%' }} position="bottom" onClose={ () => { setShowIcon(false) } } />
<Popup closeable visible={ showIconPosition } style={{ height: '20%' }} closeIconPosition="top-left" position="bottom" onClose={ () => { setShowIconPosition(false) } } />
<Popup closeable visible={ showIconDefine } style={{ height: '20%' }} closeIcon="heart" position="bottom" onClose={ () => { setShowIconDefine(false) } } />
</>
);
};
......@@ -108,7 +108,7 @@ const App = () => {
return (
<>
<Cell title="圆角弹框" isLink onClick={() => { setShowBottomRound(true) }}/>
<Popup closeable visible={ showBottomRound } style={{ height: '20%' }} position="bottom" round onClose={ () => { setShowBottomRound(false) } }></Popup>
<Popup closeable visible={ showBottomRound } style={{ height: '20%' }} position="bottom" round onClose={ () => { setShowBottomRound(false) } } />
</>
);
};
......
......@@ -54,10 +54,10 @@ const App = () => {
<Cell title="底部彈出" isLink onClick={() => { setShowBottom(true) }}/>
<Cell title="左側彈出" isLink onClick={() => { setShowLeft(true) }}/>
<Cell title="右側彈出" isLink onClick={() => { setShowRight(true) }}/>
<Popup visible={ showTop } style={{ height: '20%' }} position="top" onClose={ () => { setShowTop(false) } }></Popup>
<Popup visible={ showBottom } style={{ height: '20%' }} position="bottom" onClose={ () => { setShowBottom(false) } }></Popup>
<Popup visible={ showLeft } style={{ width: '20%', height: '100%' }} position="left" onClose={ () => { setShowLeft(false) } }></Popup>
<Popup visible={ showRight } style={{ width: '20%', height: '100%' }} position="right" onClose={ () => { setShowRight(false) } }></Popup>
<Popup visible={ showTop } style={{ height: '20%' }} position="top" onClose={ () => { setShowTop(false) } } />
<Popup visible={ showBottom } style={{ height: '20%' }} position="bottom" onClose={ () => { setShowBottom(false) } } />
<Popup visible={ showLeft } style={{ width: '20%', height: '100%' }} position="left" onClose={ () => { setShowLeft(false) } } />
<Popup visible={ showRight } style={{ width: '20%', height: '100%' }} position="right" onClose={ () => { setShowRight(false) } } />
</>
);
};
......@@ -83,9 +83,9 @@ const App = () => {
<Cell title="關閉圖標" isLink onClick={() => { setShowIcon(true) }}/>
<Cell title="圖標位置" isLink onClick={() => { setShowIconPosition(true) }}/>
<Cell title="自定義圖標" isLink onClick={() => { setShowIconDefine(true) }}/>
<Popup closeable visible={ showIcon } style={{ height: '20%' }} position="bottom" onClose={ () => { setShowIcon(false) } }></Popup>
<Popup closeable visible={ showIconPosition } style={{ height: '20%' }} closeIconPosition="top-left" position="bottom" onClose={ () => { setShowIconPosition(false) } }></Popup>
<Popup closeable visible={ showIconDefine } style={{ height: '20%' }} closeIcon="heart" position="bottom" onClose={ () => { setShowIconDefine(false) } }></Popup>
<Popup closeable visible={ showIcon } style={{ height: '20%' }} position="bottom" onClose={ () => { setShowIcon(false) } } />
<Popup closeable visible={ showIconPosition } style={{ height: '20%' }} closeIconPosition="top-left" position="bottom" onClose={ () => { setShowIconPosition(false) } } />
<Popup closeable visible={ showIconDefine } style={{ height: '20%' }} closeIcon="heart" position="bottom" onClose={ () => { setShowIconDefine(false) } } />
</>
);
};
......@@ -108,7 +108,7 @@ const App = () => {
return (
<>
<Cell title="圓角彈框" isLink onClick={() => { setShowBottomRound(true) }}/>
<Popup closeable visible={ showBottomRound } style={{ height: '20%' }} position="bottom" round onClose={ () => { setShowBottomRound(false) } }></Popup>
<Popup closeable visible={ showBottomRound } style={{ height: '20%' }} position="bottom" round onClose={ () => { setShowBottomRound(false) } } />
</>
);
};
......
......@@ -4,6 +4,7 @@ import { render, fireEvent } from '@testing-library/react'
import '@testing-library/jest-dom'
import { Rate } from '../rate'
const publicCls =
'nut-rate-item__icon nut-rate-item__icon--disabled nut-icon nutui-iconfont'
test('spacing & count & modelValue & checkedIcon & uncheckedIcon & readonly & iconSize & activeColor & voidColor & change test', () => {
......@@ -46,26 +47,26 @@ test('spacing & count & modelValue & checkedIcon & uncheckedIcon & readonly & ic
const valueEl = container.querySelector('.curModelValue')
const el = container.querySelectorAll('.nut-rate-item')
if (el && valueEl) {
expect(el.length).toBe(state.count) //count
expect(el.length).toBe(state.count) // count
expect(el[0].childNodes[0]).toHaveClass(
//modelValue
// modelValue
'nut-rate-item__icon nut-icon nutui-iconfont nut-icon-star-fill-n'
)
expect(el[0].childNodes[0]).toHaveAttribute(
//activeColor && iconSize
// activeColor && iconSize
'style',
'color: red; font-size: 18px; width: 18px; height: 18px;'
)
expect(el[1].childNodes[0]).toHaveClass(`${publicCls} nut-icon-star-n`)
expect(el[1].childNodes[0]).toHaveAttribute(
//voidColor
// voidColor
'style',
'color: rgb(250, 104, 93); font-size: 18px; width: 18px; height: 18px;'
)
expect(el[0]).toHaveAttribute('style', 'margin-right: 12px;') //spacing
expect(el[0]).toHaveAttribute('style', 'margin-right: 12px;') // spacing
fireEvent.click(el[1])
expect(valueEl.innerHTML).toBe('2') //change api test
expect(valueEl.innerHTML).toBe('2') // change api test
}
})
......
......@@ -6,7 +6,7 @@ const TimeDetailDemo = () => {
<>
<div className="demo">
<h2>基础用法</h2>
<TimeDetail></TimeDetail>
<TimeDetail />
</div>
</>
)
......
......@@ -6,7 +6,7 @@ const TimePannelDemo = () => {
<>
<div className="demo">
<h2>基础用法</h2>
<TimePannel></TimePannel>
<TimePannel />
</div>
</>
)
......
......@@ -38,7 +38,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -78,7 +78,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -117,7 +117,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -157,7 +157,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -197,7 +197,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -240,7 +240,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -282,7 +282,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
<Button type="primary" className="m-b" onClick={changeVideo}>Video switching</Button>
</>
......
......@@ -40,7 +40,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -80,7 +80,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -119,7 +119,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -159,7 +159,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -199,7 +199,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -242,7 +242,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -284,7 +284,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
<Button type="primary" className="m-b" onClick={changeVideo}>视频切换</Button>
</>
......
......@@ -40,7 +40,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -80,7 +80,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -119,7 +119,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -159,7 +159,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -199,7 +199,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -243,7 +243,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
</>
)
......@@ -285,7 +285,7 @@ const App = () => {
play={play}
pause={pause}
playend={playend}
></Video>
/>
</Cell>
<Button type="primary" className="m-b" onClick={changeVideo}>視頻切換</Button>
</>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册