test(components): [card] add optional chaining (#8058)

This commit is contained in:
류한경
2022-06-03 02:40:44 +09:00
committed by GitHub
parent 86ef8abbb7
commit 63cbc59e2a

View File

@@ -55,7 +55,7 @@ describe('Card.vue', () => {
const style = [{ 'font-size': '14px' }, { color: 'blue' }]
const wrapper = mount(() => <Card bodyStyle={style}>{AXIOM}</Card>)
expect(
wrapper.find('.el-card__body').attributes('style').replace(/[ ]/g, '')
wrapper.find('.el-card__body').attributes('style')?.replace(/[ ]/g, '')
).toBe('font-size:14px;color:blue;')
})