import { expect } from 'chai';
import { mount } from 'enzyme';
import React from 'react';
import Post from '../../src/js/components/Post';

describe('<Post/>', () => {
  const post = {
    id: 0,
    title: 'Test Post',
    content: 'empty',
    description: 'empty',
    author: 'bot',
    slug: 'test-post',
    tags: ['test', 'react'],
  };

  it('renders post title', () => {
    const result = mount(<Post post={post} />);
    expect(result.find('.post__title').text()).to.eq('Test Post');
  });

  it('renders post metadata', () => {
    const result = mount(<Post post={post} />);
    expect(result.find('.post__meta').text()).to.eq('  a few seconds ago');
  });
});

@@ -662,13 +662,382 @@
 );%0A  %7D);
+%0A%0A  it('renders post image', () =%3E %7B%0A    const postWithImage = %7B ...post, img: 'image.png' %7D;%0A    const result = mount(%3CPost post=%7BpostWithImage%7D /%3E);%0A    expect(result.find('.post__image').length).to.eq(1);%0A  %7D);%0A%0A  it('renders no image if missing', () =%3E %7B%0A    const result = mount(%3CPost post=%7Bpost%7D /%3E);%0A    expect(result.find('.post__image').length).to.eq(0);%0A  %7D);
 %0A%7D);%0A

Add tests for post image in <Post> spec