udpated button snapshots

This commit is contained in:
andres alcocer
2022-12-23 18:38:37 -05:00
parent 2f2c4dead5
commit 086562a40d
3 changed files with 24 additions and 0 deletions

View File

@@ -34,6 +34,13 @@ Primary.args = {
buttonType: ButtonType.Primary, buttonType: ButtonType.Primary,
} }
export const PrimaryWithCustomClass = Template.bind({})
PrimaryWithCustomClass.args = {
label: 'Primary Custom',
buttonType: ButtonType.Primary,
customClassName: 'custom-class-name',
}
export const Secondary = Template.bind({}) export const Secondary = Template.bind({})
Secondary.args = { Secondary.args = {
label: 'Secondary', label: 'Secondary',

View File

@@ -6,6 +6,7 @@ import {
SecondaryWithIcon, SecondaryWithIcon,
Alternate, Alternate,
IconRoundSecondary, IconRoundSecondary,
PrimaryWithCustomClass,
} from './Button.stories' } from './Button.stories'
import { render } from '@testing-library/react' import { render } from '@testing-library/react'
@@ -48,4 +49,8 @@ describe('Button constructor', (): void => {
const { container } = render(<Alternate {...Alternate.args} />) const { container } = render(<Alternate {...Alternate.args} />)
expect(container).toMatchSnapshot() expect(container).toMatchSnapshot()
}) })
test('should render custom css class name', (): void => {
const { container } = render(<Primary {...PrimaryWithCustomClass.args} />)
expect(container).toMatchSnapshot()
})
}) })

View File

@@ -12,6 +12,18 @@ exports[`Button constructor should render alternate button 1`] = `
</div> </div>
`; `;
exports[`Button constructor should render custom css class name 1`] = `
<div>
<button
class="n-button with-label custom-class-name Primary"
>
<span>
Primary Custom
</span>
</button>
</div>
`;
exports[`Button constructor should render icon round button 1`] = ` exports[`Button constructor should render icon round button 1`] = `
<div> <div>
<button <button