Skip to content

Commit

Permalink
test(space): fix
Browse files Browse the repository at this point in the history
  • Loading branch information
07akioni committed Nov 18, 2021
1 parent b1eb17d commit 66f4e2d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/space/tests/Space.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('n-space', () => {
it('render space string size', () => {
const wrapper = mount({
render () {
return <NSpace size="large" />
return <NSpace size="large">{{ default: () => 'kirby' }}</NSpace>
}
})
expect(wrapper.attributes('style')).toContain('margin')
Expand All @@ -40,7 +40,7 @@ describe('n-space', () => {
const size = 20
const wrapper = mount({
render () {
return <NSpace size={size} />
return <NSpace size={size}>{{ default: () => 'kirby' }}</NSpace>
}
})
expect(wrapper.attributes('style')).toContain(`margin-top: -${size / 2}px`)
Expand Down Expand Up @@ -87,6 +87,9 @@ describe('n-space', () => {
const wrapper = mount(NSpace, {
props: {
inline: true
},
slots: {
default: () => '07akioni'
}
})

Expand Down
18 changes: 13 additions & 5 deletions src/space/tests/__snapshots__/Space.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`n-space render custom style space 1`] = `
</div>"
`;
exports[`n-space render empty children 1`] = `"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -4px; margin-bottom: -4px;\\"></div>"`;
exports[`n-space render empty children 1`] = `"<!---->"`;
exports[`n-space render justify space 1`] = `
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -4px; margin-bottom: -4px;\\">
Expand Down Expand Up @@ -63,9 +63,17 @@ exports[`n-space render justify space 5`] = `
</div>"
`;
exports[`n-space render space number size 1`] = `"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -10px; margin-bottom: -10px;\\"></div>"`;
exports[`n-space render space number size 1`] = `
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -10px; margin-bottom: -10px;\\">
<div role=\\"none\\" style=\\"max-width: 100%; padding-top: 10px; padding-bottom: 10px;\\">kirby</div>
</div>"
`;
exports[`n-space render space string size 1`] = `"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -6px; margin-bottom: -6px;\\"></div>"`;
exports[`n-space render space string size 1`] = `
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -6px; margin-bottom: -6px;\\">
<div role=\\"none\\" style=\\"max-width: 100%; padding-top: 6px; padding-bottom: 6px;\\">kirby</div>
</div>"
`;
exports[`n-space render vertical space 1`] = `
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: column; justify-content: flex-start; flex-wrap: nowrap;\\">
Expand All @@ -78,9 +86,9 @@ exports[`n-space render vertical space 1`] = `
</div>"
`;
exports[`n-space should not render while slot is Comment 1`] = `"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -4px; margin-bottom: -4px;\\"></div>"`;
exports[`n-space should not render while slot is Comment 1`] = `"<!---->"`;
exports[`n-space should not render while v-if is false 1`] = `"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -4px; margin-bottom: -4px;\\"></div>"`;
exports[`n-space should not render while v-if is false 1`] = `"<!---->"`;
exports[`n-space should render with invalidElement 1`] = `
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -4px; margin-bottom: -4px;\\">
Expand Down

0 comments on commit 66f4e2d

Please sign in to comment.