wagtail/client/template/component.test.mst

25 lines
773 B
Text

// TODO Move this file to the client/tests/components directory.
import React from 'react';
import { expect } from 'chai';
import { shallow, mount, render } from 'enzyme';
import '../stubs';
import {{ name }} from '../../src/components/{{ slug }}/{{ name }}';
describe('{{ name }}', () => {
it('exists', () => {
expect({{ name }}).to.exist;
});
it('contains spec with an expectation', () => {
expect(shallow(<{{ name }} />).contains(<div className="c-{{ slug }}" />)).to.equal(true);
});
it('contains spec with an expectation', () => {
expect(shallow(<{{ name }} />).is('.c-{{ slug }}')).to.equal(true);
});
it('contains spec with an expectation', () => {
expect(mount(<{{ name }} />).find('.c-{{ slug }}').length).to.equal(1);
});
});