From 27086911f288fb13d6203d80bc77ed337975d71a Mon Sep 17 00:00:00 2001 From: Vincent Smedinga Date: Fri, 27 Oct 2023 15:24:34 +0200 Subject: [PATCH] Test for zero start and span class names --- packages/react/src/Grid/GridCell.test.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/react/src/Grid/GridCell.test.tsx b/packages/react/src/Grid/GridCell.test.tsx index 0375a579f1..6eb621f41d 100644 --- a/packages/react/src/Grid/GridCell.test.tsx +++ b/packages/react/src/Grid/GridCell.test.tsx @@ -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() + const { container } = render() + 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() const component = container.querySelector(':only-child')