Skip to content

Commit

Permalink
Test for zero start and span class names
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentSmedinga committed Oct 27, 2023
1 parent 4964ff6 commit 2708691
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/react/src/Grid/GridCell.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ describe('GridCell', () => {
expect(ref.current).toBe(component)
})

it('generates no class names for undefined values for start and span', () => {
const ref = createRef<HTMLDivElement>()
const { container } = render(<GridCell ref={ref} />)
const elementWithSpanClass = container.querySelector('[class*="amsterdam-grid-cell--span"]')
const elementWithStartClass = container.querySelector('[class*="amsterdam-grid-cell--start"]')
expect(elementWithSpanClass).not.toBeInTheDocument()
expect(elementWithStartClass).not.toBeInTheDocument()
})

it('generates class names for single number values for start and span', () => {
const { container } = render(<GridCell span={4} start={2} />)
const component = container.querySelector(':only-child')
Expand Down

0 comments on commit 2708691

Please sign in to comment.