Default content
', ...overrides, }) as EvaluatedBlockTest content
Test content
Test content
', classes: 'custom-class', }) const result = await HtmlBlock.render(block) expect(result).toBe('Test content
Test content
', attributes: { 'data-test': 'value', id: 'test-id', }, }) const result = await HtmlBlock.render(block) expect(result).toBe('Test content
Test content
', classes: 'custom-class', attributes: { 'data-test': 'value', }, }) const result = await HtmlBlock.render(block) expect(result).toBe('Test content
By proceeding, you agree to our Terms of Service
By proceeding, you agree to our Terms of Service
Hello world
') }) it('should apply classes to the tag element', async () => { // Arrange const block = mockBlock({ tag: 'h1', content: 'Title', classes: 'govuk-heading-l' }) // Act const result = await HtmlBlock.render(block) // Assert expect(result).toBe('Text
') }) it('should apply both classes and attributes to the tag element', async () => { // Arrange const block = mockBlock({ tag: 'p', content: 'Text', classes: 'govuk-body', attributes: { 'data-test': 'value' }, }) // Act const result = await HtmlBlock.render(block) // Assert expect(result).toBe('Text
') }) it('should render void elements as self-closing', async () => { // Arrange const block = mockBlock({ tag: 'hr', classes: 'govuk-section-break' }) // Act const result = await HtmlBlock.render(block) // Assert expect(result).toBe('