Skip to content

Commit

Permalink
feat: add variant in status component (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathdevelop authored May 16, 2024
1 parent e36318c commit 4ff2faf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions styleguide/src/Indicators/Status/Status.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ describe(specTitle('Status tests'), () => {
mount(<Default type="success" />)
cy.get('.indicator-status').find('.rounded-full').should('have.class', 'bg-success')

mount(<Default type="successDark" />)
cy.get('.indicator-status').find('.rounded-full').should('have.class', 'bg-success-dark')

mount(<Default type="warning" />)
cy.get('.indicator-status').find('.rounded-full').should('have.class', 'bg-warning')

Expand All @@ -36,4 +39,9 @@ describe(specTitle('Status tests'), () => {
cy.get('.indicator-status *').first().contains('Aprovado')
})

it('Description', () => {
mount(<Default description={<strong>Aprovado</strong>} />)
cy.get('.indicator-status').find('strong').contains('Aprovado')
})

})
3 changes: 2 additions & 1 deletion styleguide/src/Indicators/Status/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react'
const statusTypes = {
default: 'bg-inverted-2',
success: 'bg-success',
successDark: 'bg-success-dark',
warning: 'bg-warning',
danger: 'bg-danger',
dangerLight: 'bg-danger-light',
Expand Down Expand Up @@ -56,7 +57,7 @@ export interface StatusProps {
/**
* Status additional text
* */
description?: string
description?: React.ReactNode | string
/** Invert icon and text position
* @default false
* */
Expand Down

0 comments on commit 4ff2faf

Please sign in to comment.