import maxContent from '../maxContent'

describe('maxContent', () => {
  const obj = {x: 1}
  const str = JSON.stringify(obj)

  it('passes when the content is under the max', () => {
    const result = maxContent(obj, {limit: str.length})
    expect(result).to.be.undefined()
  })

  it('fails when the content is over the max', () => {
    const result = maxContent(obj, {limit: str.length - 1})
    expect(result).to.eq('Maximum content exceeded')
  })
})
