<commit_before>import React from 'react';
import ReactDOM from 'react-dom';
import TestUtils from 'react-addons-test-utils';
import { expect } from 'chai';
import { renderOnce } from 'test/helpers/render';

import Link from '#link';

describe.skip('link', () => {
    describe('basic', () => {
        it('exists', () => {
            expect(Link).to.exist;
        });

        it('is a component', () => {
            expect(TestUtils.isCompositeComponent(renderOnce(Link()))).to.be.true;
        });
    });

    describe('render', () => {
        beforeEach(function() {
            this.renderWithProps = props => {
                this.rootComponent = renderOnce(Link(props));
                this.rootComponentDOMNode = ReactDOM.findDOMNode(this.rootComponent);
            };

            this.renderWithProps();
        });

        describe('DOM', () => {
            it('initial', function() {
                expect(this.rootComponentDOMNode.tagName).to.be.equal('A');
                expect(this.rootComponentDOMNode).to.be.a.block('link');
            });

            it('props', function() {
                this.renderWithProps({
                    href: '#test'
                });

                expect(this.rootComponentDOMNode.href).to.be.equal(location.href + '#test');
            });

            it('children', function() {
                this.renderWithProps({
                    children: React.createElement('div', {
                        key: 'test',
                        className: 'test-children'
                    })
                });

                expect(
                    TestUtils.findRenderedDOMComponentWithClass(this.rootComponent, 'test-children')
                ).to.be.block('test-children');
            });
        });
    });
});<commit_msg>:space_invader: refactor Link tests with Enzyme<commit_after>import TestUtils from 'react-addons-test-utils';
import { expect } from 'chai';
import { shallow } from 'enzyme';

import Link from '#link';

describe('a', function() {
    describe('basic', function() {
        it('exists', function() {
            expect(Link).to.exist;
        });

        it('is a component', function() {
            expect(TestUtils.isElement(Link())).to.be.true;
        });
    });

    describe('render', function() {
        describe('DOM', function() {
            it('initial', function() {
                const component = shallow(Link());

                expect(component).to.have.tagName('a');
                expect(component).to.be.a.block('link');
            });
        });
    });
});
{'fraction_non_alphanumeric': 0.1597222222222222, 'fraction_numerical': 0.0, 'mean_word_length': 1.7941810344827587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '200886', 'n_tokens_mistral': 702, 'n_tokens_neox': 667, 'n_words': 110}