import React from 'react'
import renderer from 'react-test-renderer'
import { ContentLayout } from '../index'
describe('ContentLayout', () => {
it('renders full-grid layout with container correctly', () => {
const tree = renderer
.create(
Test content
)
.toJSON()
expect(tree).toMatchSnapshot()
})
it('renders mid-grid layout with container correctly', () => {
const tree = renderer
.create(
Test content
)
.toJSON()
expect(tree).toMatchSnapshot()
})
it('renders in-line layout with container correctly', () => {
const tree = renderer
.create(
Test content
)
.toJSON()
expect(tree).toMatchSnapshot()
})
it('renders inset-left layout with container correctly', () => {
const tree = renderer
.create(
Test content
)
.toJSON()
expect(tree).toMatchSnapshot()
})
it('renders inset-right layout with container correctly', () => {
const tree = renderer
.create(
Test content
)
.toJSON()
expect(tree).toMatchSnapshot()
})
describe('Edge cases', () => {
it('handles empty children', () => {
const tree = renderer
.create(
)
.toJSON()
expect(tree).toMatchSnapshot()
})
it('handles null children', () => {
const tree = renderer
.create(
{null}
)
.toJSON()
expect(tree).toMatchSnapshot()
})
it('handles conditional children', () => {
const showContent = true
const tree = renderer
.create(
{showContent &&
Conditional content
}
{!showContent &&
Alternative content
}
)
.toJSON()
expect(tree).toMatchSnapshot()
})
})
})