mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-03-07 13:48:31 +08:00
test(table): update test (#1729)
This commit is contained in:
parent
82c3757ee9
commit
6742f634b4
@ -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', () => {
|
||||
|
7
src/table/tests/__snapshots__/Table.spec.ts.snap
Normal file
7
src/table/tests/__snapshots__/Table.spec.ts.snap
Normal 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);"`;
|
Loading…
Reference in New Issue
Block a user