import React from 'react'
import IfFeature from '../presenter'

describe('IfFeature', () => {
  const props = {
    children: <div>myChildContent</div>,
    name: 'feature'
  }

  context('with feature off', () => {
    const testbed = createTestbed(IfFeature, { ...props, isOn: false })

    it('should not render children', () => {
      testbed.render()
      expect(testbed.getText()).to.not.include('myChildContent')
    })
  })

  context('with feature on', () => {
    const testbed = createTestbed(IfFeature, { ...props, isOn: true })

    it('should render children', () => {
      testbed.render()
      expect(testbed.getText()).to.include('myChildContent')
    })
  })
})
