test(table): update test (#1729)

This commit is contained in:
XieZongChen 2021-12-02 19:49:06 -06:00 committed by GitHub
parent 82c3757ee9
commit 6742f634b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -49,6 +49,13 @@ describe('n-table', () => {
'n-table--single-line'
)
})
it('should work with `size` prop', async () => {
;(['small', 'medium', 'large'] as const).forEach((size) => {
const wrapper = mount(NTable, { props: { size } })
expect(wrapper.find('.n-table').attributes('style')).toMatchSnapshot()
})
})
})
describe('n-table-body', () => {

View File

@ -0,0 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`n-table should work with \`size\` prop 1`] = `"--bezier: cubic-bezier(.4, 0, .2, 1); --td-color: #fff; --td-color-modal: #fff; --td-color-popover: #fff; --td-text-color: rgb(51, 54, 57); --border-color: rgba(239, 239, 245, 1); --border-color-modal: rgba(239, 239, 245, 1); --border-color-popover: rgba(239, 239, 245, 1); --border-radius: 3px; --font-size: 14px; --th-color: rgba(250, 250, 252, 1); --th-color-modal: rgba(250, 250, 252, 1); --th-color-popover: rgba(250, 250, 252, 1); --th-font-weight: 500; --th-text-color: rgb(31, 34, 37); --line-height: 1.6; --td-padding: 6px; --th-padding: 6px; --td-color-striped: rgba(250, 250, 252, 1); --td-color-striped-modal: rgba(250, 250, 252, 1); --td-color-striped-popover: rgba(250, 250, 252, 1);"`;
exports[`n-table should work with \`size\` prop 2`] = `"--bezier: cubic-bezier(.4, 0, .2, 1); --td-color: #fff; --td-color-modal: #fff; --td-color-popover: #fff; --td-text-color: rgb(51, 54, 57); --border-color: rgba(239, 239, 245, 1); --border-color-modal: rgba(239, 239, 245, 1); --border-color-popover: rgba(239, 239, 245, 1); --border-radius: 3px; --font-size: 14px; --th-color: rgba(250, 250, 252, 1); --th-color-modal: rgba(250, 250, 252, 1); --th-color-popover: rgba(250, 250, 252, 1); --th-font-weight: 500; --th-text-color: rgb(31, 34, 37); --line-height: 1.6; --td-padding: 12px; --th-padding: 12px; --td-color-striped: rgba(250, 250, 252, 1); --td-color-striped-modal: rgba(250, 250, 252, 1); --td-color-striped-popover: rgba(250, 250, 252, 1);"`;
exports[`n-table should work with \`size\` prop 3`] = `"--bezier: cubic-bezier(.4, 0, .2, 1); --td-color: #fff; --td-color-modal: #fff; --td-color-popover: #fff; --td-text-color: rgb(51, 54, 57); --border-color: rgba(239, 239, 245, 1); --border-color-modal: rgba(239, 239, 245, 1); --border-color-popover: rgba(239, 239, 245, 1); --border-radius: 3px; --font-size: 15px; --th-color: rgba(250, 250, 252, 1); --th-color-modal: rgba(250, 250, 252, 1); --th-color-popover: rgba(250, 250, 252, 1); --th-font-weight: 500; --th-text-color: rgb(31, 34, 37); --line-height: 1.6; --td-padding: 12px; --th-padding: 12px; --td-color-striped: rgba(250, 250, 252, 1); --td-color-striped-modal: rgba(250, 250, 252, 1); --td-color-striped-popover: rgba(250, 250, 252, 1);"`;