Skip to content

Commit

Permalink
the solution is working with the yarn.lock from master
Browse files Browse the repository at this point in the history
  • Loading branch information
andra-sava committed Jul 16, 2024
1 parent e6262f9 commit 93ec55a
Show file tree
Hide file tree
Showing 4 changed files with 4,970 additions and 2,485 deletions.
18 changes: 6 additions & 12 deletions src/components/buttons/Button/Button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,30 @@ const basicColors = [
{ color: 'rose' },
{ color: 'secondary' },
{ color: 'success' },
{ color: 'warning' }
{ color: 'warning' },
{ color: 'white' }
] satisfies { color: Color }[]

const whiteColor = { color: 'white' } satisfies { color: Color }

describe('Button colors', () => {
describe('Button basic colors', () => {
it.each(basicColors)('displays the correct background color for color = { $color }', ({ color }) => {
render(<Button color={color} />)
expect(screen.getByRole('button')).toHaveStyle(`background-color: ${theme.palette[color]?.dark}`)
})

it('displays the correct background color for color = `white`', () => {
render(<Button color={whiteColor.color} />)
expect(screen.getByRole('button')).toHaveStyle(`background-color: ${theme.palette[whiteColor.color]?.main}`)
expect(screen.getByRole('button')).toHaveStyle(`background-color: ${theme.palette[color]?.main}`)
})
})

describe('Button `noBackground` colors', () => {
it('displays the correct font color and background color for color = `transparent`', () => {
render(<Button color={'transparent'} />)
const button = screen.getByRole('button')
//expect(button).toHaveStyle('background-color: transparent')
expect(button).toHaveStyle('background-color: transparent')
expect(button).toHaveStyle(`color: ${theme.palette['primary'].main}`)
expect(button).toHaveClass('MuiButton-text')
})

it('displays primary background color by default', () => {
render(<Button />)
expect(screen.getByRole('button')).toHaveStyle(`background-color: ${theme.palette['primary'].dark}`)
expect(screen.getByRole('button')).toHaveStyle(`background-color: ${theme.palette['primary'].main}`)
})
})
})
Expand Down Expand Up @@ -91,4 +85,4 @@ describe('Other button functionalities', () => {
render(<Button capitalize={false}>Text</Button>)
expect(screen.getByText('Text')).toHaveStyle('text-transform: none')
})
})
})
8 changes: 4 additions & 4 deletions src/components/feedback/Dialog/Dialog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ describe('DialogDisplay', () => {
expect(screen.getByText(buttonText).parentElement).toHaveStyle('background-color: red')
})

// test('Close button can be overridden through the closeButtonProps', () => {
// render(<Dialog id="dialog" open={true} content={text} closeButtonProps={{ sx: { backgroundColor: 'red' } }} />)
// expect(screen.getByLabelText('Close')).toHaveStyle('background-color: red')
// })
test('Close button can be overridden through the closeButtonProps', () => {
render(<Dialog id="dialog" open={true} content={text} closeButtonProps={{ sx: { backgroundColor: 'red' } }} />)
expect(screen.getByLabelText('Close')).toHaveStyle('background-color: red')
})
})
1 change: 0 additions & 1 deletion src/components/inputs/Autocomplete/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-nocheck
import { createFilterOptions } from '@mui/material/Autocomplete'
import { prop, map, innerJoin, find, propEq, all, includes, is, isEmpty, isNil, props, omit, equals, any } from 'ramda'
import { AutocompleteValue, FilterOptionsState } from '@mui/material'
Expand Down
Loading

0 comments on commit 93ec55a

Please sign in to comment.